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 committed Sep 16, 2023
1 parent 7c6ea05 commit 12e3ad5
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 12e3ad5

Please sign in to comment.