Conversation
| Returns None if not found. | ||
| """ | ||
| try: | ||
| if not request.scope: |
There was a problem hiding this comment.
When will a request wont have a scope? and can this create an issue with us unable to collect the trace in this case?
There was a problem hiding this comment.
well it shouldn't happen as its a part of the ASGI interface. Anyway, we check it so we will be failsafe (at this unexpected scenario it will be fine to collect a trace)
| json.dumps(loop.run_until_complete(request.json())) | ||
| ) | ||
| except json.decoder.JSONDecodeError: | ||
| pass |
There was a problem hiding this comment.
DecodeError might happen only if the json was empty? if not maybe we should log this error as well?
There was a problem hiding this comment.
well it was actually with log error before and it was spammy (every empty body caused this log)
| epsagon_scope[SCOPE_IGNORE_REQUEST] = True | ||
|
|
||
| except Exception as exception: # pylint: disable=W0703 | ||
| return original_handler(*args, **kwargs) |
There was a problem hiding this comment.
Seems like most of the catch blocks are doing the same call and catching all exceptions, possible to create a bigger try catch block? Also this method (_fastapi_handler) gets to much big and to many returns, we should try to split it into smaller methods and this "# pylint: disable=too-many-return-statements" might not be needed then
There was a problem hiding this comment.
I will try to split it, but some of the except Exception adds some logic (print_debug, warning, setting some var names)
There was a problem hiding this comment.
splitted the function ;)
|
🎉 This PR is included in version 1.64.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.