def METHOD_NAME(exc, message=None):
    Logger.get('flask').exception(str(exc) or 'Uncaught Exception')
    if not current_app.debug or request.is_xhr or request.is_json:
        sentry_sdk.capture_exception(exc)
        if message is None:
            message = f'{type(exc).__name__}: {str(exc)}'
        if os.environ.get('INDICO_DEV_SERVER') == '1':
            # If we are in the dev server, we always want to see a traceback on the
            # console, even if this was an API request.
            traceback.print_exc()
        return render_error(exc, _('Something went wrong'), message, 500)
    # Let the exception propagate to middleware / the webserver.
    # This triggers the Flask debugger in development and sentry
    # logging (if enabled) (via got_request_exception).
    raise