Commit 6076bef3 by qwmqiuwenmin

fix

parent 7ebb360a
...@@ -38,23 +38,23 @@ public class GlobalExceptionHandler extends WebBaseController { ...@@ -38,23 +38,23 @@ public class GlobalExceptionHandler extends WebBaseController {
} }
@ResponseBody // @ResponseBody
@ExceptionHandler(RuntimeException.class) // @ExceptionHandler(RuntimeException.class)
public HaobanResponse ControllerException(HttpServletResponse response, RuntimeException ex) { // public HaobanResponse ControllerException(HttpServletResponse response, RuntimeException ex) {
HaobanResponse res = new HaobanResponse(); // HaobanResponse res = new HaobanResponse();
res.setErrorCode(HaoBanErrCode.ERR_3.getCode()); // res.setErrorCode(HaoBanErrCode.ERR_3.getCode());
String message = ex.getMessage(); // String message = ex.getMessage();
if (message != null && message.indexOf(ShowFrontMessageException.class.getName()) > -1) { // if (message != null && message.indexOf(ShowFrontMessageException.class.getName()) > -1) {
Matcher matcher = pattern.matcher(message); // Matcher matcher = pattern.matcher(message);
while (matcher.find()) { // while (matcher.find()) {
message = (matcher.group(2)); // message = (matcher.group(2));
} // }
} else { // } else {
message = HaoBanErrCode.ERR_3.getMsg(); // message = HaoBanErrCode.ERR_3.getMsg();
} // }
res.setMessage(message); // res.setMessage(message);
return res; // return res;
} // }
// @ResponseBody // @ResponseBody
// @ExceptionHandler(Exception.class) // @ExceptionHandler(Exception.class)
......
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