is there a way to get the stack trace to display in console when a Concordion test fails

162 Views Asked by At

This error stack seems to appear in html doc but I want it to be displayed in console to make it easy for debugging.

1

There are 1 best solutions below

0
Nigel Charman On

There's nothing built-in to Concordion to do this, but it's pretty easy with a Concordion extension.

For example:

@Extension
ConcordionExtension exceptionLogger = new ConcordionExtension() {

    @Override
    public void addTo(ConcordionExtender concordionExtender) {
        concordionExtender.withThrowableListener(new ThrowableCaughtListener() {

            @Override
            public void throwableCaught(ThrowableCaughtEvent event) {
                event.getThrowable().getCause().printStackTrace();
            }
        });
    }
};