Closed eddybl closed 1 year ago
I looked into the behavior of the Authentication
class a bit more and I think there are some more general issues:
login()
etc are not used anywhere, since the returns are never used. This should probably be prints instead (for debugging)login()
seem to use a fixed version:
, although they should probably all use version: self._version
You are now logged in!
It surely needs to improve, I was working on error handling function as PR #100 suggest but I wasn't much into it. Ill try to work on it and take your suggestion time permitting
I will try to work on a pull request. Once I started looking into it it got just bigger then I originally thought, so it might take a couple of days to find enough time ;)
lol me too, however I'll do my best to improve this part
ok so based on PR #100 and very little changes I managed to let error codes work and implemented in all modules, I still need to add it for logout process. I can upload to a new branck and if you want to test too would be great
check it out at error codes branch
Ok, I will try to have a look this evening!
I added a PR on the error_code branch: #108
closed with PR #109
I am just starting with the API and tried to connect using the core module.
For me,
base_api_core.Core()
failed on line 9:Relevant part of the traceback:
The error is misleading, since
auth.login()
has no error checking on therequests.get()
result, but what happens is thatsession_request .json()
has this content:And finally,
402
seems to be permission denied.My first suggestion would be to improve the
auth.login()
in a similar fashion toauth.logou()
and check forBut there is also a PR which tries to improve the situation: https://github.com/N4S4/synology-api/pull/100 I like the addition of the error codes, but since the original author was not responding I wonder if it makes sense to make a similar PR which resolves your requests?