Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ebaysdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _execute_http_request(self):

return response_data

# Child classes can override this method based on what the errors in the
# Child classes should override this method based on what the errors in the
# XML response body look like. They can choose to look at the 'ack',
# 'Errors', 'errorMessage' or whatever other fields the service returns.
# the implementation below is the original code that was part of error()
Expand All @@ -250,7 +250,11 @@ def _get_resp_body_errors(self):
return self._resp_body_errors

err = []
for e in self.response_dom().getElementsByTagName("Errors"):
if self.verb is None: return err
dom = self.response_dom()
if dom is None: return err

for e in dom.getElementsByTagName("Errors"):

if e.getElementsByTagName('ErrorClassification'):
err.append('- Class: %s' % nodeText(e.getElementsByTagName('ErrorClassification')[0]))
Expand Down Expand Up @@ -647,7 +651,7 @@ def load_from_app_config(self, app_config):

# Note: this method will always return at least an empty object_dict!
# It used to return None in some cases. If you get an empty dict,
# you can use the .errors() method to look for the cause.
# you can use the .error() method to look for the cause.
def response_dict( self ):
if self._response_dict: return self._response_dict

Expand Down