Umbraco update

Error email updates
Piscal communication error handling
Empty page for terms of service
This commit is contained in:
2017-01-04 08:49:36 -05:00
parent 8f5399e746
commit 9e710effc1
15 changed files with 228 additions and 25 deletions
+25 -3
View File
@@ -34,13 +34,23 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
protected string FormatException(Exception ex)
{
return
(ex is PiscalClientException ? $"LeafInput: {((PiscalClientException) ex).LeafInputId}{Environment.NewLine}" : "") +
(ex is PiscalClientException ? $"LeafInputId: {((PiscalClientException) ex).LeafInputId}{Environment.NewLine}" : "") +
$"Class: {GetType().Name}{Environment.NewLine}" +
$"Exception message: {ex.Message}{Environment.NewLine}" +
(ex.InnerException != null ? $"InnerException: {ex.InnerException}{Environment.NewLine}" : string.Empty)
+ $"StackTrace: {ex.StackTrace}";
}
protected string FormatLeafInputInfo(LeafInput leafInput)
{
return
$"User name: {leafInput.Name}{Environment.NewLine}" +
$"User email: {leafInput.Email}{Environment.NewLine}" +
$"Identifier: {leafInput.Identifier}{Environment.NewLine}" +
$"Site Id: {leafInput.SiteId}{Environment.NewLine}" +
$"Photosynthesis Type: {leafInput.PhotosynthesisType}{Environment.NewLine}";
}
protected void PiscalExceptionHandler(PiscalClientException ex, LeafInput leafInput)
{
var errorMessage = FormatException(ex);
@@ -48,7 +58,13 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
// send admin an email
BackgroundJobEnqueueRetry<EmailNotificationService>(
email => email.SendAdministratorMessage($"LeafWeb: PiscalQueue {GetType().Name} Exception", errorMessage));
email => email.SendAdministratorMessage(
$"LeafWeb: PiscalQueue {GetType().Name} Exception",
"Piscal exception reported. LeafInput info:" + Environment.NewLine
+ FormatLeafInputInfo(leafInput)
+ Environment.NewLine
+ "ErrorMessage:" + Environment.NewLine
+ errorMessage));
// send user email too
BackgroundJobEnqueueRetry<EmailNotificationService>(
@@ -67,7 +83,13 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
// send admin an email
BackgroundJobEnqueueRetry<EmailNotificationService>(
email => email.SendAdministratorMessage($"LeafWeb: PiscalQueue {GetType().Name} Warning", warningMessage));
email => email.SendAdministratorMessage(
$"LeafWeb: PiscalQueue {GetType().Name} Warning",
"Piscal warning reported. LeafInput info:" + Environment.NewLine
+ FormatLeafInputInfo(leafInput)
+ Environment.NewLine
+ "Warning message:" + Environment.NewLine
+ warningMessage));
}
public void Dispose()
@@ -83,7 +83,8 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
Logger.InfoFormat("LeafInput: {0}, Starting", pendingInputId);
try
{
DataService.SetLeafInputStatus(pendingInput, LeafInputStatusType.Starting);
DataService.SetLeafInputStatus(pendingInput, LeafInputStatusType.Starting,
details: $"File count: {pendingInput.InputFiles.Count}");
BackgroundJobEnqueueRetry<StartPending>(c => c.DoWork(pendingInputId));
}
catch (Exception ex)
@@ -26,6 +26,8 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
{
}
public string ServiceDescription => "Host: " + _piscalClient.Host;
public void Run(LeafInput leafInput)
{
var inputFile = new PiscalLeafInput(leafInput);
+1 -1
View File
@@ -10,7 +10,7 @@ namespace LeafWeb.WebCms.Services.PiscalQueue
PiscalService.Run(leafInput);
DataService.SetLeafInputStatus(leafInput, LeafInputStatusType.Running);
DataService.SetLeafInputStatus(leafInput, LeafInputStatusType.Running, details: $"ServiceInfo: {PiscalService.ServiceDescription}");
}
}
}