Print stacktrace as it emits an exception