/// <summary> /// 500: Server failure /// </summary> public static APIResponse Failure(APIErrorCode code, object result = null, string format = null, params object[] args) { return(new APIResponse(HttpStatusCode.InternalServerError, new Response() { ErrorCode = code, ErrorDesc = code.ToDescription(format), Data = result ?? new object(), })); }
/// <summary> /// 400: Failed request result or invalid data passed /// </summary> public static APIResponse BadRequest(APIErrorCode code, string format = null, params object[] args) { return(new APIResponse(HttpStatusCode.BadRequest, new Response() { ErrorCode = code, ErrorDesc = code.ToDescription(format), Data = new object(), })); }