File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
eladmin-common/src/main/java/me/zhengjie/exception/handler
eladmin-logging/src/main/java/me/zhengjie/aspect Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,8 @@ public class GlobalExceptionHandler {
2626 * @param e
2727 * @return
2828 */
29- @ ExceptionHandler (Exception .class )
30- public ResponseEntity handleException (Exception e ){
29+ @ ExceptionHandler (Throwable .class )
30+ public ResponseEntity handleException (Throwable e ){
3131 // 打印堆栈信息
3232 log .error (ThrowableUtil .getStackTrace (e ));
3333 ApiError apiError = new ApiError (BAD_REQUEST .value (),e .getMessage ());
Original file line number Diff line number Diff line change @@ -42,14 +42,10 @@ public void logPointcut() {
4242 * @param joinPoint join point for advice
4343 */
4444 @ Around ("logPointcut()" )
45- public Object logAround (ProceedingJoinPoint joinPoint ){
45+ public Object logAround (ProceedingJoinPoint joinPoint ) throws Throwable {
4646 Object result = null ;
4747 currentTime = System .currentTimeMillis ();
48- try {
49- result = joinPoint .proceed ();
50- } catch (Throwable e ) {
51- throw new BadRequestException (e .getMessage ());
52- }
48+ result = joinPoint .proceed ();
5349 Log log = new Log ("INFO" ,System .currentTimeMillis () - currentTime );
5450 logService .save (joinPoint , log );
5551 return result ;
You can’t perform that action at this time.
0 commit comments