diff --git a/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs b/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs index 09a2b40c..f51f59f2 100644 --- a/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs +++ b/EnvelopeGenerator.Application/Pdf/BurnPdfCommand.cs @@ -71,15 +71,15 @@ public class BurnPdfCommandHandler : IRequestHandler .Include(env => env.Documents!).ThenInclude(doc => doc.Elements!).ThenInclude(element => element.Annotations) .FirstOrDefaultAsync(cancel) ?? throw new BadRequestException($"Envelope could not be found. Request details:\n" + - System.Text.Json.JsonSerializer.Serialize(request, Format.Json.ForDiagnostics)); + request.ToJson(Format.Json.ForDiagnostics)); var doc = envelope.Documents?.FirstOrDefault() ?? throw new NotFoundException($"Document could not be located within the specified envelope. Request details:\n" + - System.Text.Json.JsonSerializer.Serialize(request, Format.Json.ForDiagnostics)); + request.ToJson(Format.Json.ForDiagnostics)); if (doc.ByteData is null) throw new InvalidOperationException($"Document byte data is missing, indicating a potential data integrity issue. Request details:\n" + - System.Text.Json.JsonSerializer.Serialize(request, Format.Json.ForDiagnostics)); + request.ToJson(Format.Json.ForDiagnostics)); return doc.Elements?.SelectMany(e => e.Annotations ?? Enumerable.Empty()).Where(annot => annot is not null).Any() ?? false ? BurnElementAnnotsToPDF(doc.ByteData, doc.Elements)