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 14, 2023
1 parent abb1e46 commit c63b4b1
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 c63b4b1

Please sign in to comment.