Commit 5ee7bdd0 authored by yanzg's avatar yanzg

状态异常类

parent 60237a90
...@@ -9,7 +9,7 @@ public class StatusException extends RuntimeException { ...@@ -9,7 +9,7 @@ public class StatusException extends RuntimeException {
/** /**
* 错误状态码 * 错误状态码
*/ */
private int code; private int status;
/** /**
* 错误结果 * 错误结果
...@@ -93,44 +93,44 @@ public class StatusException extends RuntimeException { ...@@ -93,44 +93,44 @@ public class StatusException extends RuntimeException {
/** /**
* 途必达自定义异常 * 途必达自定义异常
* *
* @param code 错误码 * @param status 错误码
* @param format 格式化字符串 * @param format 格式化字符串
* @param paras 参数 * @param paras 参数
*/ */
public StatusException(int code, String format, Object... paras) { public StatusException(int status, String format, Object... paras) {
super(String.format(format, paras)); super(String.format(format, paras));
this.result = null; this.result = null;
this.code = code; this.status = status;
} }
/** /**
* 途必达自定义异常 * 途必达自定义异常
* *
* @param result 结果 * @param result 结果
* @param code 错误码 * @param status 错误码
* @param format 格式化字符串 * @param format 格式化字符串
* @param paras 参数 * @param paras 参数
*/ */
public StatusException(Object result, int code, String format, Object... paras) { public StatusException(Object result, int status, String format, Object... paras) {
super(String.format(format, paras)); super(String.format(format, paras));
this.result = result; this.result = result;
this.code = code; this.status = status;
} }
/** /**
* 获取状态 * 获取状态
* @return * @return
*/ */
public int getCode() { public int getStatus() {
return code; return status;
} }
/** /**
* 状态码 * 状态码
* @param code * @param status
*/ */
public void setCode(int code) { public void setStatus(int status) {
this.code = code; this.status = status;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment