|  |  | 
 |  |  | package com.zy.acs.manager.common.exception; | 
 |  |  |  | 
 |  |  | import com.zy.acs.framework.exception.CoolException; | 
 |  |  | import com.zy.acs.manager.common.constant.Constants; | 
 |  |  | import com.zy.acs.manager.common.utils.CommonUtil; | 
 |  |  | import com.zy.acs.framework.common.R; | 
 |  |  | 
 |  |  |     @ExceptionHandler(HttpRequestMethodNotSupportedException.class) | 
 |  |  |     public R methodNotSupportedExceptionHandler(HttpRequestMethodNotSupportedException e, | 
 |  |  |                                                 HttpServletResponse response) { | 
 |  |  |         e.printStackTrace(); | 
 |  |  |         CommonUtil.addCrossHeaders(response); | 
 |  |  |         return R.error("请求方式不正确"); | 
 |  |  |     } | 
 |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ResponseBody | 
 |  |  |     @ExceptionHandler(CoolException.class) | 
 |  |  |     public R coolExceptionHandler(CoolException e, HttpServletResponse response) { | 
 |  |  |         CommonUtil.addCrossHeaders(response); | 
 |  |  |         return R.error(e.getMessage()); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     @ResponseBody | 
 |  |  |     @ExceptionHandler(Throwable.class) | 
 |  |  |     public R exceptionHandler(Throwable e, HttpServletResponse response) { | 
 |  |  |         logger.error(e.getMessage(), e); |