/// <summary> /// HTTPS 验证异常 /// </summary> /// <returns></returns> public static ExceptionResponseViewModel CreateHttpsExceptionResponse() { var ex = new ExceptionResponseViewModel() { ErrorCode = 3, ErrorMessage = "HTTPS Required", }; // 生产环境不需要抛出异常。测试系统,都需展示异常信息; //if (!BConfigs.DebugMode) //{ // ex.ErrorMessage = "后台服务正在进行升级,请稍后再试,敬请谅解。"; //} return(ex); }
public static ExceptionResponseViewModel CreateExceptionResponse(string message) { var ex = new ExceptionResponseViewModel() { ErrorCode = -1, ErrorMessage = "系统异常!" + message, }; // 生产环境不需要抛出异常。测试系统,都需展示异常信息; //if (!BConfigs.DebugMode) //{ // ex.ErrorMessage = "后台服务正在进行升级,请稍后再试,敬请谅解。"; //} return(ex); }