Which status code used for all uncaught exceptions by default?

Technology CommunityCategory: ASP.NET Web APIWhich status code used for all uncaught exceptions by default?
VietMX Staff asked 3 years ago

500 – Internal Server Error

Consider:

[Route("CheckId/{id}")]
[HttpGet]
public IHttpActionResult CheckId(int id)
{
    if(id > 100)
    {
        throw new ArgumentOutOfRangeException();
    }
    return Ok(id);
}

And the result: