only log errors to sentry if not in debug mode.