protected static JsonResponseErrorOnly Error(HttpStatusCode statusCode, IError error) => JsonResponse.FromError( new HttpRemotingException( statusCode, error.GetType().Name, error.ErrorMessage));
protected static JsonResponseErrorOnly Unexpected(object message) => JsonResponse.FromError( new HttpRemotingException( HttpStatusCode.InternalServerError, message.GetType().Name, "Unexpected message type"));
private static void ApplyError( ActionExecutedContext context, IHttpRemotingError error) { context.Result = CreateError(JsonResponse.FromError(error)); context.ExceptionHandled = true; }