From 9420e880dd2d63c0abb7244cb81e334c0890ad9e Mon Sep 17 00:00:00 2001 From: Hocine Hacherouf Date: Thu, 14 Sep 2023 18:27:25 +0200 Subject: [PATCH] Add missing pb details mapping on ResourceNotFoundException #2509 --- src/IoTHub.Portal.Server/Startup.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/IoTHub.Portal.Server/Startup.cs b/src/IoTHub.Portal.Server/Startup.cs index 0546862f1..7798f6f12 100644 --- a/src/IoTHub.Portal.Server/Startup.cs +++ b/src/IoTHub.Portal.Server/Startup.cs @@ -110,6 +110,13 @@ public void ConfigureServices(IServiceCollection services) Status = StatusCodes.Status500InternalServerError }); + setup.Map(exception => new ProblemDetails + { + Title = exception.Title, + Detail = exception.Detail, + Status = StatusCodes.Status404NotFound + }); + setup.Map(exception => new ProblemDetails { Title = exception.Title,