stianaske / pybotvac

Python module for interacting with Neato Botvac Connected vacuum robots.
MIT License
84 stars 44 forks source link

Neato exceptions #49

Closed dshokouhi closed 4 years ago

dshokouhi commented 5 years ago

Making our requests exceptions more user friendly providing some feedback around what is failing and adding more try/catch blocks against all requests to neato cloud. Please feel free to tweak as needed :)

If possible please publish a new package to pypi so we can include this in home assistant :)

dshokouhi commented 5 years ago

@stianaske what is your take on this implementation? Do you think we need to get more specific with error messaging? Like should we detect when a user changes their password, or if the neato api is having issues?

Santobert commented 5 years ago

Maybe we should add TimeoutError and handle it same as ConnectionError. How about TooManyRedirects?

https://stackabuse.com/the-python-requests-module/

--- Edit ---

In order to use timeouts we have to configure them:

We can configure requests to stop waiting for a network requests using the timeout parameter. By default, requests will not timeout.

I guess it's same for redirections. What do you guys think? Should we limit timout and redirections?

Santobert commented 5 years ago

@dshokouhi There are two files exceptions.py now. One in the root directory and one in pybotvac. I think we only need the second one. Do you agree?

stianaske commented 4 years ago

Looks good. Great work!