![JAR search and dependency download from the Maven repository](/logo.png)
com.github.markusbernhardt.selenium2library.aspects.RunOnFailureAspect.aj Maven / Gradle / Ivy
package com.github.markusbernhardt.selenium2library.aspects;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import com.github.markusbernhardt.selenium2library.RunOnFailureKeywords;
public aspect RunOnFailureAspect {
private static ThreadLocal lastThrowable = new ThreadLocal();
pointcut handleThrowable() :
execution(public * com.github.markusbernhardt.selenium2library.keywords.*.*(..));
after() throwing(Throwable t) : handleThrowable() {
if (lastThrowable.get() == t) {
// Already handled this Throwable
return;
}
((RunOnFailureKeywords) thisJoinPoint.getTarget()).runOnFailureByAspectJ();
lastThrowable.set(t);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy