Add output file type, collect all files
This commit is contained in:
@@ -31,24 +31,28 @@ namespace LeafWeb.Web.Services.PiscalQueue
|
||||
|
||||
protected PiscalQueueBase() : this(new DataService(), new PiscalService()) { }
|
||||
|
||||
protected string FormatException(Exception ex, int leafInputId)
|
||||
protected string FormatException(Exception ex)
|
||||
{
|
||||
return
|
||||
$"LeafInput: {leafInputId}{Environment.NewLine}" +
|
||||
(ex is PiscalClientException ? $"LeafInput: {((PiscalClientException) ex).LeafInputId}{Environment.NewLine}" : "") +
|
||||
$"Class: {GetType().Name}{Environment.NewLine}" +
|
||||
$"Exception: {ex.Message}{Environment.NewLine}" +
|
||||
$"Exception message: {ex.Message}{Environment.NewLine}" +
|
||||
(ex.InnerException != null ? $"InnerException: {ex.InnerException}{Environment.NewLine}" : string.Empty)
|
||||
+ $"StackTrace: {ex.StackTrace}";
|
||||
}
|
||||
|
||||
protected void PiscalExceptionHandle(PiscalClientException ex, LeafInput leafInput)
|
||||
protected void PiscalExceptionHandler(PiscalClientException ex, LeafInput leafInput)
|
||||
{
|
||||
var errorMessage = FormatException(ex, ex.LeafInputId);
|
||||
var errorMessage = FormatException(ex);
|
||||
Logger.Error(errorMessage);
|
||||
|
||||
// send admin an email
|
||||
BackgroundJobEnqueueRetry<EmailNotificationService>(
|
||||
email => email.SendAdministratorMessage($"LeafWeb: PiscalQueue {GetType().Name} Exception", errorMessage));
|
||||
|
||||
// TODO send user email too
|
||||
// send user email too
|
||||
BackgroundJobEnqueueRetry<EmailNotificationService>(
|
||||
email => email.SendLeafWebSystemException(leafInput.Identifier, leafInput.Email));
|
||||
|
||||
if (leafInput != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user