Jordan-Prescott / odins_spear

Python library for Odin's API to build and manage Broadworks installations.
https://pypi.org/project/odins-spear/
MIT License
6 stars 1 forks source link

Add API exception #113

Closed malkin0xb8 closed 1 month ago

malkin0xb8 commented 1 month ago

Added the API exception alongside cleaned up a few area that have been made redundant

This allows for more descriptive error handling when a request exception occurs

Previous:

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.api.com/api/v2/users/call-center?userId=userID@userID.com

New:

odins_spear.exceptions.OSApiResponseError: ODIN API Error 400: [Error 4410] Service is not assigned to this subscriber: Call Center - Basic