private void HandleException(IHttpContext ctx, Exception e)
{
try
{
if (e is BadRequestException)
HandleBadRequest(ctx, (BadRequestException)e);
else if (e is ConcurrencyException)
HandleConcurrencyException(ctx, (ConcurrencyException)e);
else if (TryHandleException(ctx, e))
return;
else
HandleGenericException(ctx, e);
}
catch (Exception)
{
logger.ErrorException("Failed to properly handle error, further error handling is ignored", e);
}
}