Skip to content

Commit

Permalink
Send request exception signal in common handler (spec-first#1326)
Browse files Browse the repository at this point in the history
* Send request exception signal in common handler

* Sort imports

Co-authored-by: Robbe Sneyders <[email protected]>
  • Loading branch information
2 people authored and hauntsaninja committed Aug 10, 2022
1 parent 005d046 commit 49dd4af
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions connexion/apps/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import flask
import werkzeug.exceptions
from flask import json
from flask import json, signals

from ..apis.flask_api import FlaskApi
from ..exceptions import ProblemException
Expand Down Expand Up @@ -40,11 +40,11 @@ def set_errors_handlers(self):

self.add_error_handler(ProblemException, self.common_error_handler)

@staticmethod
def common_error_handler(exception):
def common_error_handler(self, exception):
"""
:type exception: Exception
"""
signals.got_request_exception.send(self.app, exception=exception)
if isinstance(exception, ProblemException):
response = problem(
status=exception.status, title=exception.title, detail=exception.detail,
Expand Down

0 comments on commit 49dd4af

Please sign in to comment.