printing stacktrace when in debug mode of uncaught errors