Closed mlindner closed 8 years ago
Ah, good point! I was going to implement this but I knew it would be a bunch of repetitive boilerplate and ended up forgetting.
I'll probably just implement a simple method that checks to see if credentials have been loaded (and that they passed verif_auth()), raise exceptions accordingly, and call it at the beginning of each function that accesses the API. I'll get around to this once I figure out how exactly I should manage credentials. Check out the other issue you posted, I had a question there -- after that, this issue is trivial to solve.
I'll implement the changes from the other issue, as well as this issue and close this when the code has been implemented.
In hindsight, I probably should have kept both issues open, but wanted to give a 'resolution' to our discussion in the other issue. Thanks again for your critique.
Anime searches silently fail if the user doesn't previously load credentials. The user has no way of knowing that credentials are needed for doing an anime search with the API. Possibly fail early before attempting to connect if credentials are not loaded. Or possibly fail when the query_soup variable returns very specifically "Invalid credentials".