无论何时被调用或发生任何异常,我都被写成我想要的一个方面,我们将其重定向到http://google.com
@AfterThrowing(pointcut = "execution(* com.ts.templateService.*.*(..))", throwing = "e")
public void LocalAfterThrowing(JoinPoint joinPoint, Throwable e) {
Signature signature = joinPoint.getSignature();
String methodName = signature.getName();
String stuff = signature.toString();
String arguments = Arrays.toString(joinPoint.getArgs());
System.out.println("Got Exception in the Method: "
+ methodName + " with arguments "
+ arguments + "\nand the full toString: " + stuff + "\nthe exception is: "
+ e.getMessage());
}