Catch all unexpected errors in with Pyax queries and report as a PyaxUnexpectedError with details.

Bug #438232 reported by Kevin Shuk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pyax
New
Undecided
Unassigned

Bug Description

Use case: at one point, Salesforce returned a non-valid-xml response to a query, which it should never do. Although we couldn't fix it, a good error here indicating what SF returned would have helped in diagnosing and reporting the error to SF.

The traceback showed where there error occurred, but why was the sobject_result a string and what string was it?

Traceback (most recent call last):
  File "/srv/salesforce/production/production/sfi-salesforce/bin/../canonical/salesforce/remote_orders/licences.py", line 213, in <module>
    LicenceKey.refill()
  File "/srv/salesforce/production/production/sfi-salesforce/bin/../canonical/salesforce/remote_orders/licences.py", line 140, in refill
    lic_count_result = sfdc.query(qry)
  File "/srv/salesforce/production/production/sfi-pyax/pyax/connection.py", line 615, in query
    return self.__processQueryResult(query_result)
  File "/srv/salesforce/production/production/sfi-pyax/pyax/connection.py", line 663, in __processQueryResult
    query_result_batch = self.__resultToObject(sobject_records)
  File "/srv/salesforce/production/production/sfi-pyax/pyax/connection.py", line 321, in __resultToObject
    if isinstance(sobject_result.get('Id'), list):
AttributeError: 'unicode' object has no attribute 'get'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.