The stacktrace should only be printed if PrintStackTraceOnError is set.