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

Capture exception #4

Open
maxpowel opened this issue Apr 28, 2016 · 2 comments
Open

Capture exception #4

maxpowel opened this issue Apr 28, 2016 · 2 comments
Assignees

Comments

@maxpowel
Copy link

Hi, very useful library!
I need to capture the exception for report it (I'm using sentry) but the exception is captured and formatted as string so most information are lost. I only need to report the errors of my application (unhandled exceptions for example).

I saw that here is where the error is processed
rest.py

Override the method gen_http_error does not help because the exception is already transformed into a string. A method that receives the exception that I can override would be great, and by default this method format the exception as it does now.

I could send you a pull request (there are just a few lines) unless you have a way to do it.

Thank you!

@rancavil rancavil self-assigned this Oct 5, 2016
@Gnurfos
Copy link

Gnurfos commented Mar 23, 2017

Hi,

Just a note, since I see recent activity in this repo: this feature/fix is also interesting to me, and the lack of it would probably prevent me from using this lib.

Cheers

@rancavil
Copy link
Owner

Hi.

Was added kwparam _catch_fire to raise exceptions, additionally to http response when occurs an error.

If your need that the exceptions be throws, use _catch_fire kwparam equals True in the decorator.

 @post(_path="/person",_types[dict],_consumes=mediatypes.APPLICATION_JSON,
                                         _produces=mediatypes.APPLICATION_JSON,
                                         _catch_fire=True)
      def postPerson(self,p):
                # Do something

Regards

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

3 participants