Skip to content

Commit

Permalink
CSC-6035 Fix AttributeError in Office365ClientError
Browse files Browse the repository at this point in the history
  • Loading branch information
amatsukov-sugarcrm committed Oct 4, 2024
1 parent 611cb85 commit 543156e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions office365_api/v2/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class Office365ClientError(Exception):

def __init__(self, status_code, data):
self.status_code = status_code
data = data or {}
self.error_code = data.get('error', {}).get('code', '')
self.error_message = data.get('error', {}).get('message', '')
super(Office365ClientError, self).__init__('{}: {}: {}'.format(
Expand Down
2 changes: 1 addition & 1 deletion office365_api/v2/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def execute(self):
exception = None
try:
if response['status'] >= 300:
error_data = response['body']
error_data = response.get('body')
raise Office365ClientError(response['status'], error_data)
except Office365ClientError as e:
exception = e
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from setuptools import find_packages, setup

setup(name='office365-rest-client',
version='3.3.3',
description='Python api wrapper for Office365 API v3.3.1',
version='3.3.4',
description='Python api wrapper for Office365 API v3.3.4',
author='SugarCRM',
packages=find_packages(),
install_requires=[
Expand Down

0 comments on commit 543156e

Please sign in to comment.