meraki / dashboard-api-python

Official Dashboard API library (SDK) for Python
MIT License
293 stars 154 forks source link

Wrong exception handling: Can't append str to dict #147

Closed coreGreenberet closed 3 years ago

coreGreenberet commented 3 years ago

If you are making an API call to an organization which doesn't have the API enabled, then you will receive a dictionary as the response message.

Response:

{'errors': ['To make requests you must first enable API access via https://nXXX.meraki.com/o/XXXXX/manage/organization/edit']

The current APIErrror treats it as an missing api key (which error message is just a text) and tries to add a string to a dict. https://github.com/meraki/dashboard-api-python/blob/master/meraki/exceptions.py#L24