Skip to content

Commit

Permalink
[client] Do not log error in API catch
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelHassine committed Oct 28, 2023
1 parent 56f2fc9 commit 178e770
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pycti/api/opencti_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,22 +365,16 @@ def query(self, query, variables={}):
else main_error["message"]
)
if "data" in main_error and "reason" in main_error["data"]:
# Warning here because the error should be caught at a higher level
LOGGER.warning(main_error["data"]["reason"])
raise ValueError(
{"name": error_name, "message": main_error["data"]["reason"]}
)
else:
# Warning here because the error should be caught at a higher level
LOGGER.warning(main_error["message"])
raise ValueError(
{"name": error_name, "message": main_error["message"]}
)
else:
return result
else:
# Info here because the error should be caught at a higher level
LOGGER.info(r.text)
raise ValueError(r.text)

def fetch_opencti_file(self, fetch_uri, binary=False, serialize=False):
Expand Down

0 comments on commit 178e770

Please sign in to comment.