Forum Discussion
Your form swallows the caught exception, but you manually capture the stack trace. Alternatively, you could preserve the underlying exception by passing it to the SnapDataException using this constructor:
SnapDataException(Document document, Throwable cause, String message);
Often times, the snap exception is written to the error view.
errorViews.write(snapDataException)
There is a write() which accepts a document too
errorViews.write(snapDataException, document)
The write will extract the underlying exception and stringify it, something like:
import com.google.common.base.Throwables;
Throwables.getStackTraceAsString( snapDataException.getCause() );
Throwables is a Guava class. Your vanilla Java approach works too – a bit more work. Anyway, the stack trace of the root exception should display in the error view.