API

class flask.ext.exceptional.Exceptional(app=None)

Extension for tracking application errors with Exceptional. Errors are not tracked if DEBUG is True. The application will log a warning if no EXCEPTIONAL_API_KEY has been configured.

Parameters:

app – Default None. The Flask application to track errors for. If the app is not provided on creation, then it can be provided later via init_app().

static context(data=None, **kwargs)

Add extra context data to the current tracked exception. The context data is only valid for the current request. Multiple calls to this method will update any existing context with new data.

Parameters:

  • data – Default None. A dictionary of context data.
  • **kwargs – A series of keyword arguments to use as context data.

init_app(app)

Initialize this Exceptional extension.

Parameters:

app – The Flask application to track errors for.

static publish(config, traceback)

Publish the given traceback directly to Exceptional. This method is useful for tracking errors that occur outside the context of a Flask request. For example, this may be called from an asynchronous queue.

Parameters:

  • config – A Flask application configuration object. Accepts either flask.Config or the object types allowed by flask.Config.from_object().
  • traceback – A werkzeug.debug.tbtools.Traceback instance to publish.

static test(config)

Test the given Flask configuration. If configured correctly, an error will be tracked by Exceptional for your app. Unlike the initialized extension, this test will post data to Exceptional, regardless of the configured DEBUG setting.

Parameters:

config – The Flask application configuration object to test. Accepts either flask.Config or the object types allowed by flask.Config.from_object().