Commit 3dbe6c70 authored by yanzg's avatar yanzg

异常处理显示

parent 44e7a702
package com.yanzuoguang.util.exception;
import com.yanzuoguang.util.contants.ResultConstants;
import com.yanzuoguang.util.helper.StringHelper;
import com.yanzuoguang.util.vo.ResponseResult;
/**
......@@ -57,7 +58,11 @@ public class ExceptionHelper {
CodeException code = (CodeException) e;
return new ResponseResult(code.getCode(), code.getMessage(), null, code.getTarget());
} else {
return new ResponseResult(ResultConstants.UNKNOW_ERROR, e.getMessage());
String msg = e.getMessage();
if (StringHelper.isEmpty(msg)) {
msg = e.getClass().getName();
}
return ResponseResult.error(ResultConstants.UNKNOW_ERROR, msg, e);
}
}
}
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