Add 'Raises' section to docstring
https://github.com/wattsight/wapi-python/blob/dc0d3534b4c8fe0bcc577ac25d93ebeffdfd2dc0/wapi/session.py#L115
I might have the expectation from the documentation that I will get a curve or None - in fact I get an exception if the curve is not found.
https://github.com/wattsight/wapi-python/blob/dc0d3534b4c8fe0bcc577ac25d93ebeffdfd2dc0/wapi/session.py#L470
Any response from the API that does not return the HTTP code OK 200 will throw an exception. The API returns 404 when a curve is missing, an instance is missing etc. The API returns the appropriate HTTP error code where this makes sense. 403/401 for various authorization/authentication issues. We can also return other 4xx errors when your request exceeds limits or is otherwise malformed. 500 is returned when something has gone wrong in the API.
Returning None would not give you the error message or opportunity to handle the error correctly, which is why we throw the error(s).
I think perhaps that not finding a curve is not an "exceptional event" and is in fact normal operation. However I understand your desire to communicate the error condition to the user - however none of what you have explained above is documented anywhere. Which is the point of this issue :)
We are indeed lacking some cases around exception handling.
I will look into it for the upcoming release. We plan to add type hints to the upcoming release to ease these bits. It should be solved as a part of that process.