void intercept()

in module/geb-spock/src/main/groovy/geb/spock/OnFailureReporter.groovy [27:43]


    void intercept(IMethodInvocation invocation) throws Throwable {
        try {
            invocation.proceed()
        } catch (IncompleteExecutionException notACauseForReporting) {
            throw notACauseForReporting
        } catch (Throwable throwable) {
            ManagedGebTest spec = invocation.instance
            if (spec.testManager.reportingEnabled) {
                try {
                    spec.testManager.reportFailure()
                } catch (Exception reportingException) {
                    throwable.addSuppressed(reportingException)
                }
            }
            throw throwable
        }
    }