public MessageResponse VendorReport() { var response = new MessageResponse() { code = 200 }; LOGGER.Info("Begin module."); try { var module = new CustomVendorReport(); module.GetVendorsAndSendEmail(); } catch (Exception ex) { response.code = 500; response.addMessage("An error has occurred."); LOGGER.Error(ex.Message, ex); return(response); } response.addMessage("Successfully."); LOGGER.Info("Successfully."); return(response); }