"""Error handler functions for specific types of failures.""" from flask import g from sentry_sdk import capture_exception def log_db_exception(exception): """Log a DB exception to Sentry and Loggly.""" capture_exception() g.ows.log.error('DB error: {}'.format(exception))