示例#1
0
        public static JsonResult RespondUnhandledError(object data, ErrorCode errorCode)
        {
            var response = new ErrorResponseObject
            {
                ResponseType = "error",
                Data         = data,
                ErrorCode    = errorCode
            };

            return(new JsonWithHttpCodeResult(response, HttpStatusCode.InternalServerError));
        }
示例#2
0
        public static JsonResult RespondHandledError(object data, ErrorCode errorCode)
        {
            var response = new ErrorResponseObject
            {
                ResponseType = "error",
                Data         = data,
                ErrorCode    = errorCode
            };

            return(new JsonWithHttpCodeResult(response, HttpStatusCode.BadRequest));
        }