Skip to content

Commit

Permalink
Add missing pb details mapping on ResourceNotFoundException #2509
Browse files Browse the repository at this point in the history
  • Loading branch information
hocinehacherouf authored and kbeaugrand committed Sep 16, 2023
1 parent ac8568e commit 9420e88
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/IoTHub.Portal.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ public void ConfigureServices(IServiceCollection services)
Status = StatusCodes.Status500InternalServerError
});

setup.Map<ResourceNotFoundException>(exception => new ProblemDetails
{
Title = exception.Title,
Detail = exception.Detail,
Status = StatusCodes.Status404NotFound
});

setup.Map<BaseException>(exception => new ProblemDetails
{
Title = exception.Title,
Expand Down

0 comments on commit 9420e88

Please sign in to comment.