ej2 / python-quickbooks

A Python library for accessing the Quickbooks API.
MIT License
402 stars 194 forks source link

ErrorCode 3100 (InternalServerError) returned as ValidationError #300

Open jarekwg opened 1 year ago

jarekwg commented 1 year ago

Curious why this code is getting bundled with the 2XXX errors...

Would make more sense to me as either

Thanks for this SDK! Super handy! :)

ej2 commented 1 year ago

Because the exceptions were based on an older version of the QBO API. I see now that they have updated the docs for error codes. I will try to get that updated in the next release.

jarekwg commented 1 year ago

Awesome thanks! Appreciate it! Amusingly, 3100 isn't mentioned in those docs at all.

If it helps, here's the error i was getting back from quickbooks the other day:

QuickbooksException - Error returned with status code '500': {
  "warnings":null,
  "intuitObject":null,
  "fault":{
    "error":[
      {
        "message":"message=InternalServerError; errorCode=003100; statusCode=500",
        "detail":null,
        "code":"3100",
        "element":null
      }
    ],
    "type":"SERVICE"
  },
  "report":null,
  "queryResponse":null,
  "batchItemResponse":[],
  "attachableResponse":[],
  "syncErrorResponse":null,
  "requestId":null,
  "time":1682319632796,
  "status":null,
  "cdcresponse":[]
}

Might help to map off response.status_code before jumping into the more granular quickbooks codes.

Cheers!