private HttpResponseMessage HandleInvalidVersionEx(InvalidVersionFormatException ex) { var resp = new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = "version_bad_format" }; return resp; }
private HttpResponseMessage HandleInvalidVersionEx(InvalidVersionFormatException ex) { var resp = new HttpResponseMessage(HttpStatusCode.BadRequest) { ReasonPhrase = "version_bad_format" }; return(resp); }
public override void OnException(HttpActionExecutedContext actionExecutedContext) { Exception ex = actionExecutedContext.Exception; BucketNotFoundException bEx = ex as BucketNotFoundException; if (bEx != null) { actionExecutedContext.Response = HandleBucketNotFoundEx(bEx); return; } DocumentNotFoundException dEx = ex as DocumentNotFoundException; if (dEx != null) { actionExecutedContext.Response = HandleDocNotFoundEx(dEx); return; } InvalidVersionFormatException ivEx = ex as InvalidVersionFormatException; if (ivEx != null) { actionExecutedContext.Response = HandleInvalidVersionEx(ivEx); return; } ConflictException cfEx = ex as ConflictException; if (cfEx != null) { actionExecutedContext.Response = HandleConflictEx(cfEx); return; } actionExecutedContext.Response = new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent("An error occurred, please try again or contact the administrator."), ReasonPhrase = "internal_error" }; }