From 3a8466ef15478a197c780063c89ab825ecabd121 Mon Sep 17 00:00:00 2001 From: michal-dagan Date: Mon, 30 Sep 2024 18:34:57 +0300 Subject: [PATCH] update --- .../Integrations/MicrosoftGraphAPI/MicrosoftGraphAPI.py | 6 +++++- Packs/MicrosoftGraphAPI/ReleaseNotes/1_1_50.md | 6 ++++++ Packs/MicrosoftGraphAPI/pack_metadata.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 Packs/MicrosoftGraphAPI/ReleaseNotes/1_1_50.md diff --git a/Packs/MicrosoftGraphAPI/Integrations/MicrosoftGraphAPI/MicrosoftGraphAPI.py b/Packs/MicrosoftGraphAPI/Integrations/MicrosoftGraphAPI/MicrosoftGraphAPI.py index 712cea62c7a..558c321cbc5 100644 --- a/Packs/MicrosoftGraphAPI/Integrations/MicrosoftGraphAPI/MicrosoftGraphAPI.py +++ b/Packs/MicrosoftGraphAPI/Integrations/MicrosoftGraphAPI/MicrosoftGraphAPI.py @@ -69,7 +69,11 @@ def generic_request( json_data=request_body, resp_type='resp', ) - return res.json() if res.content else None + try: + return res.json() if res.content else None + except json.decoder.JSONDecodeError as e: + demisto.debug(f"Failed to decode JSON: {str(e)}. Response content: {res.content}") + return res.content def start_auth(client: MsGraphClient) -> CommandResults: # pragma: no cover diff --git a/Packs/MicrosoftGraphAPI/ReleaseNotes/1_1_50.md b/Packs/MicrosoftGraphAPI/ReleaseNotes/1_1_50.md new file mode 100644 index 00000000000..2210c275300 --- /dev/null +++ b/Packs/MicrosoftGraphAPI/ReleaseNotes/1_1_50.md @@ -0,0 +1,6 @@ + +#### Integrations + +##### Microsoft Graph API + +Fixed an issue where empty, invalid, or non-JSON responses could cause errors. \ No newline at end of file diff --git a/Packs/MicrosoftGraphAPI/pack_metadata.json b/Packs/MicrosoftGraphAPI/pack_metadata.json index 2711445d7ef..088ce5d89c8 100644 --- a/Packs/MicrosoftGraphAPI/pack_metadata.json +++ b/Packs/MicrosoftGraphAPI/pack_metadata.json @@ -2,7 +2,7 @@ "name": "Microsoft Graph API", "description": "Use the Microsoft Graph API integration to interact with Microsoft APIs that do not have dedicated integrations in Cortex XSOAR, for example, Mail Single-User, etc.", "support": "xsoar", - "currentVersion": "1.1.49", + "currentVersion": "1.1.50", "author": "Cortex XSOAR", "url": "https://www.paloaltonetworks.com/cortex", "email": "",