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()