Print stack trace from exception in debug mode