We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug Using FalconPy to delete a session returns a 204 from the API, but the JSONDecoderError is not handled resulting in an error 500.
This snippet produces the anticipated response from the API (a 204), but the JSON decoder exception handler does not capture the error properly.
delete = connection.command("RTR_DeleteSession", session_id=resources[session]['session_id'])
You can see the Debug response here in urllib3 showing the 204 with an empty content, followed by the unhandled JSON decode error:
The core problem appears to be that the AWS Lambda Runtime environment leverages the simplejson instead of json package. Full stack trace:
simplejson
json
[ERROR] 2023-04-16T23:51:06.345Z 75589bd5-05ac-46da-982f-e63ec503ce44 Expecting value: line 1 column 1 (char 0) Traceback (most recent call last): File "/opt/python/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "/var/runtime/simplejson/__init__.py", line 525, in loads return _default_decoder.decode(s) File "/var/runtime/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/var/runtime/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/python/falconpy/_util.py", line 270, in perform_request content_return = Result()(response.status_code, response.headers, response.json()) File "/opt/python/requests/models.py", line 975, in json raise RequestsJSONDecodeError(e.msg, e.doc, e.pos) requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
To Reproduce
Expected behavior The RTR_DeleteSession should return with a 204 status and No Content body.
Environment (please complete the following information):
Additional context I've written a simple patch for this bug in my own forked repo. Will attach the PR here.
The text was updated successfully, but these errors were encountered:
khyberspache
Successfully merging a pull request may close this issue.
Describe the bug
Using FalconPy to delete a session returns a 204 from the API, but the JSONDecoderError is not handled resulting in an error 500.
This snippet produces the anticipated response from the API (a 204), but the JSON decoder exception handler does not capture the error properly.
You can see the Debug response here in urllib3 showing the 204 with an empty content, followed by the unhandled JSON decode error:
The core problem appears to be that the AWS Lambda Runtime environment leverages the
simplejson
instead ofjson
package. Full stack trace:To Reproduce
delete = connection.command("RTR_DeleteSession", session_id=resources[session]['session_id'])
Expected behavior
The RTR_DeleteSession should return with a 204 status and No Content body.
Environment (please complete the following information):
Additional context
I've written a simple patch for this bug in my own forked repo. Will attach the PR here.
The text was updated successfully, but these errors were encountered: