Skip to content

Unhandled exception requests (500) may be stored with incorrect 200 status code #9

Closed

Description

@georgidhristov

Description

Requests ending with unhandled exceptions are now persisted correctly, but the stored status code may still be incorrect.

Some requests resulting in 500 Internal Server Error are captured with status code 200 OK.

Expected

Requests ending with unhandled exceptions should store the final response status code (500).

Actual

Requests may be stored with status code 200 before the exception handling pipeline finalizes the response.

Possible Cause

context.Response.StatusCode is captured before the final exception middleware updates the response status.

Reproduction

Create endpoint throwing exception:

throw new Exception();

Open DebugProbe dashboard and inspect stored request status.

Screenshots

Image
Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions