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
The error response parser at the moment is a naively considering any json response to be a standard TheHive error response:
def _process_error_response(self, response: requests.Response): try: json_data = response.json() except requests.exceptions.JSONDecodeError: json_data = None if json_data is None: error_text = response.text else: error_text = f"{json_data['type']} - {json_data['message']}" raise TheHiveError(message=error_text, response=response)
To fix this it might be more reasonable to do something like:
def _process_error_response(self, response: requests.Response): try: json_data = response.json() except requests.exceptions.JSONDecodeError: json_data = None if isinstance(json_data, dict) and all(["type" in json_data, "message" in json_data]): error_text = f"{json_data['type']} - {json_data['message']}" else: error_text = response.text raise TheHiveError(message=error_text, response=response)
The text was updated successfully, but these errors were encountered:
#388 - Enhance session's error parse method
8140413
Merge pull request #393 from TheHive-Project/388-enhance-sessions-err…
7082f0e
…or-parse-method #388 - Enhance session's error parse method
Successfully merging a pull request may close this issue.
The error response parser at the moment is a naively considering any json response to be a standard TheHive error response:
To fix this it might be more reasonable to do something like:
The text was updated successfully, but these errors were encountered: