Skip to content

Commit c8f59d2

Browse files
Merge pull request #118 from veracode/keyerror-fix-117
improve default handling to fix KeyError, fixes #117
2 parents 300ba4d + 314e99f commit c8f59d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

veracode_api_py/apihelper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _rest_request(self, url, method, params=None, body=None, fullresponse=False,
109109
logger.debug("API call returned non-200 HTTP status code: {}".format(r.status_code))
110110

111111
if not (r.ok):
112-
conv_id = r.headers['x-conversation-id']
112+
conv_id = r.headers.get('x-conversation-id',"Unknown")
113113
logger.debug("Error retrieving data. HTTP status code: {}, conversation id {}".format(r.status_code,conv_id))
114114
if r.status_code == 401:
115115
logger.exception(

0 commit comments

Comments
 (0)