Skip to content

Commit

Permalink
Add missing pb details mapping on ResourceNotFoundException #2509 (#2522
Browse files Browse the repository at this point in the history
)
  • Loading branch information
hocinehacherouf authored Sep 16, 2023
1 parent ac8568e commit 7a7d320
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 7a7d320

Please sign in to comment.