Add admin emailing
This commit is contained in:
@@ -81,7 +81,12 @@ namespace LeafWeb.Web.Services
|
||||
}
|
||||
catch (PiscalClientException ex)
|
||||
{
|
||||
logger.Error("LeafInputFile: {0}, ProcessQueue Exception: {1}", pending.Id, ex.Message);
|
||||
var errorMessage =
|
||||
$"LeafInputFile: {pending.Id}\r\nProcessRunning Exception: {ex.Message}"
|
||||
+ $"\r\nInnerException: {ex.InnerException}\r\nStackTrace: {ex.StackTrace}";
|
||||
logger.Error(errorMessage);
|
||||
BackgroundJob.Enqueue(() => _emailService.SendAdministratorMessage("LeafWeb ProcessQueue Exception", errorMessage));
|
||||
|
||||
_dataService.SetLeafInputStatus(pending, LeafInputStatusType.Exception, "Error occurred starting LeafInput", ex.Message);
|
||||
logger.Info("LeafInputFile: {0}, Cleanup", pending.Id);
|
||||
_piscalService.Cleanup(pending);
|
||||
@@ -140,7 +145,12 @@ namespace LeafWeb.Web.Services
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.Error("LeafInputFile: {0}, ProcessRunning Exception: {1}\r\n{2}\r\n{3}", leafInput.Id, ex.Message, ex.InnerException, ex.StackTrace);
|
||||
var errorMessage =
|
||||
$"LeafInputFile: {leafInput.Id}\r\nProcessRunning Exception: {ex.Message}"
|
||||
+ $"\r\nInnerException: {ex.InnerException}\r\nStackTrace: {ex.StackTrace}";
|
||||
logger.Error(errorMessage);
|
||||
BackgroundJob.Enqueue(() => _emailService.SendAdministratorMessage("LeafWeb ProcessRunning Exception", errorMessage));
|
||||
|
||||
_dataService.SetLeafInputStatus(leafInput, LeafInputStatusType.Exception, "Error occurred processing LeafInput", ex.Message);
|
||||
|
||||
// TODO: Send email
|
||||
|
||||
Reference in New Issue
Block a user