Skip to content

Commit

Permalink
return 400 for FormatExceptions by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Sep 8, 2015
1 parent 1f71b0d commit 7500e22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ServiceStack/HttpRequestExtensions.cs
Expand Up @@ -307,7 +307,7 @@ public static int ToStatusCode(this Exception ex)

if (ex is HttpError) return ((HttpError)ex).Status;
if (ex is NotImplementedException || ex is NotSupportedException) return (int)HttpStatusCode.MethodNotAllowed;
if (ex is ArgumentException || ex is SerializationException) return (int)HttpStatusCode.BadRequest;
if (ex is ArgumentException || ex is SerializationException || ex is FormatException) return (int)HttpStatusCode.BadRequest;
if (ex is AuthenticationException) return (int)HttpStatusCode.Unauthorized;
if (ex is UnauthorizedAccessException) return (int)HttpStatusCode.Forbidden;
if (ex is OptimisticConcurrencyException) return (int)HttpStatusCode.Conflict;
Expand Down

0 comments on commit 7500e22

Please sign in to comment.