File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
springboot-sentinel/src/main/java/com/github/lybgeek/sentinel/aspect Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 44import com .alibaba .csp .sentinel .Tracer ;
55import com .alibaba .csp .sentinel .adapter .spring .webmvc .config .BaseWebMvcConfig ;
66import com .github .lybgeek .common .exception .BizException ;
7+ import lombok .extern .slf4j .Slf4j ;
78import org .aspectj .lang .ProceedingJoinPoint ;
9+ import org .aspectj .lang .annotation .AfterThrowing ;
810import org .aspectj .lang .annotation .Around ;
911import org .aspectj .lang .annotation .Aspect ;
1012import org .aspectj .lang .annotation .Pointcut ;
3133 **/
3234@ Aspect
3335@ Component
36+ @ Slf4j
3437public class StatisticsExceptionCountAspect {
3538
3639 @ Autowired
@@ -42,7 +45,13 @@ public void pointcut(){
4245
4346 }
4447
45- @ Around ("pointcut()" )
48+ @ AfterThrowing (pointcut = "pointcut()" ,throwing = "ex" )
49+ public void afterAfterThrowing (Throwable ex ){
50+ log .info ("statisticsExceptionCount..." );
51+ traceException (ex );
52+ }
53+
54+ // @Around("pointcut()")
4655 public Object around (ProceedingJoinPoint pjp ) {
4756 try {
4857 Object result = pjp .proceed ();
You can’t perform that action at this time.
0 commit comments