Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashutosh619-sudo committed Oct 8, 2024
1 parent 7dc9acf commit b67eb29
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sageintacctsdk/apis/api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ def __post_request(self, dict_body: dict, api_url: str):
parsed_xml = xmltodict.parse(raw_response, force_list={self.__dimension})['root']
parsed_response = json.loads(json.dumps(parsed_xml))


logger.debug('Response for post request: %s', raw_response.text)
if raw_response.status_code == 200:
logger.debug('Response for post request: %s', raw_response.text)
if parsed_response['response']['control']['status'] == 'success':
api_response = parsed_response['response']['operation']

Expand Down Expand Up @@ -242,6 +241,8 @@ def __post_request(self, dict_body: dict, api_url: str):
}
raise WrongParamsError('Something went wrong', custom_response)


logger.info('Response for post request: %s', raw_response.text)
if 'result' in parsed_response:
if 'errormessage' in parsed_response['result']:
parsed_response = parsed_response['result']['errormessage']
Expand Down

0 comments on commit b67eb29

Please sign in to comment.