Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure capture() does not drop stack frames #81

Open
zachgoldstein opened this issue May 17, 2017 · 0 comments
Open

Make sure capture() does not drop stack frames #81

zachgoldstein opened this issue May 17, 2017 · 0 comments

Comments

@zachgoldstein
Copy link
Contributor

In the following example flask app, we have a report that using capture() will not report the appropriate handlers that raised the error (when running on uwsgi). Using notify() solved this problem.

from flask import Flask, jsonify
from airbrake.notifier import Airbrake

app = Flask(__name__)
ab = Airbrake(project_id=2, api_key='5a00a5340e6cac4def2262adb4ded8a4', host="http://getexceptional.me.ab")

@app.errorhandler(Exception)
def handle_error(e):
    ab.notify(e)
    return jsonify(error=str(e)), 500

@app.route('/hello')
def hello_world():
    raise Exception("Hello world failed")
    return 'Hello, World!'

@app.route('/ping')
def ping():
    raise Exception("ping failed")
    return 'Ping!'

if __name__ == '__main__':
    app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant