Skip to content

Commit

Permalink
[Core] Don't collect exceptions upon emitting TestRunFinished event
Browse files Browse the repository at this point in the history
  • Loading branch information
mpkorstanje committed Nov 27, 2022
1 parent 5cdd1c5 commit fe1d59a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void runAfterAllHooks() {
public void finishTestRun() {
log.debug(() -> "Sending test run finished event");
Throwable cucumberException = getThrowable();
emitTestRunFinished(cucumberException);
collector.executeAndThrow(() -> emitTestRunFinished(cucumberException));
}

public Throwable getThrowable() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import io.cucumber.core.backend.Pending;

import java.io.PrintStream;
import java.io.PrintWriter;

@Pending
public final class StubPendingException extends RuntimeException {

Expand All @@ -13,4 +16,14 @@ public StubPendingException(String message) {
super(message);
}

@Override
public void printStackTrace(PrintWriter printWriter) {
printWriter.print(getMessage());
}

@Override
public void printStackTrace(PrintStream printStream) {
printStream.print(getMessage());
}

}

0 comments on commit fe1d59a

Please sign in to comment.