From ad4c613f2db64c0d411746dc3e4916e6519f76ae Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Mon, 13 Jun 2022 10:02:09 -0700 Subject: [PATCH] show unhandled exception details in debug mode Signed-off-by: Matthew Fisher --- src/Web/Filters/ApiExceptionFilterAttribute.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Web/Filters/ApiExceptionFilterAttribute.cs b/src/Web/Filters/ApiExceptionFilterAttribute.cs index f8c15df80..a7bd09ee5 100644 --- a/src/Web/Filters/ApiExceptionFilterAttribute.cs +++ b/src/Web/Filters/ApiExceptionFilterAttribute.cs @@ -171,6 +171,9 @@ private void HandleUnknownException(ExceptionContext context) Title = "An error occurred while processing your request.", Type = "https://tools.ietf.org/html/rfc7231#section-6.6.1" }; + #if DEBUG + details.Detail = $"{context.Exception.GetType().Name}: {context.Exception.Message}"; + #endif context.Result = new ObjectResult(details) {