summer-java-template-service/src/main/java/com/github/jifengnan/template/service/TemplateServiceExceptionHandler.java
@ResponseBody
    @ExceptionHandler(Exception.class)
    public TemplateHttpResult handleUnexpectedException(Exception e, HttpServletRequest request) {
        log.error(e.getMessage(), e);
        return TemplateHttpResult.createForFailure(HttpStatus.INTERNAL_SERVER_ERROR.value(),
                "Sorry, an error occurred, please retry or contact the customer service. error message: " + e.getMessage(),
                request.getServletPath());
    }
/**
     * Handle exceptions which are not expected to happen during the runtime.<p/>
     * <p>
     * Generally, it means developers can do nothing when the exceptions happened because<br/>
     * 1. There's a bug, developers have to provide a new release to fix it.<br/>
     * 2. There's a hardware issue
     *
     * @param e       the exception
     * @param request current HTTP request
     * @return a standard HTTP result
     */
Handle exceptions which are not expected to happen during the runtime.

Generally, it means developers can do nothing when the exceptions happened because
1. There's a bug, developers have to provide a new release to fix it.
2. There's a hardware issue

@param e       the exception
@param request current HTTP request
@return a standard HTTP result
Handle exceptions which are not expected to happen during the runtime . Generally it means developers can do nothing when the exceptions happened because 1 . There ' s a bug developers have to provide a new release to fix it . 2 . There ' s a hardware issue @param e the exception @param request current HTTP request @return a standard HTTP result
@ResponseBody
    @ExceptionHandler(Exception.class)
    public TemplateHttpResult handleUnexpectedException(Exception e, HttpServletRequest request) {
        log.error(e.getMessage(), e);
        return TemplateHttpResult.createForFailure(HttpStatus.INTERNAL_SERVER_ERROR.value(),
                "Sorry, an error occurred, please retry or contact the customer service. error message: " + e.getMessage(),
                request.getServletPath());
    }
@ ResponseBody @ ExceptionHandler ( Exception . class ) public TemplateHttpResult handleUnexpectedException ( Exception e , HttpServletRequest request ) { log . error ( e . getMessage ( ) , e ) ; return TemplateHttpResult . createForFailure ( HttpStatus . INTERNAL_SERVER_ERROR . value ( ) , "Sorry, an error occurred, please retry or contact the customer service. error message: " + e . getMessage ( ) , request . getServletPath ( ) ) ; }
Handle exceptions which are not expected to happen during the runtime.<p/>
 <p>
 Generally, it means developers can do nothing when the exceptions happened because<br/>
 1.
Handle exceptions which are not expected to happen during the runtime . <p / > <p > Generally it means developers can do nothing when the exceptions happened because<br / > 1 .