Currently, the response of an unsuccessful API request is handed back to the caller. For example:
from cashctrl_api import CashCtrlAPIClient
cc = CashCtrlAPIClient()
response = cc.post("person/create.json", data={})
print(response.json())
## {'success': False, 'message': None, 'errors': [{'field': None, 'message': 'Either first name, last name or company must be set.'}]}
I propose that unsuccessful request lead to an error, as this is clearly not what the user expected. For example:
response = cc.post("person/create.json", data={})
APIError: 'Either first name, last name or company must be set.'
Currently, the response of an unsuccessful API request is handed back to the caller. For example:
I propose that unsuccessful request lead to an error, as this is clearly not what the user expected. For example: