Closed deflaux closed 9 years ago
Hi Nicole,
Well, for that to happen the .httr-oauth
would need to be stored in a specific place and the "secretsFile.json"
will need to always be the same name in order to differentiate it from other files and be recognizable. I posted under #10, a possible start to a solution.
Let me know what you think.
~p
Maybe just catch that specific error from all api calls (which iirc has a specific http code) and tell the user to authenticate then vs upfront?
As they say, many roads lead to Rome :) Now it's just a general catch on line 67- 69 of the client.R file, which can be easily augmented.
if("error" %in% names(content(res))) {
print(paste("ERROR:", content(res)$error[[3]]))
}
There's more room for improvement, but I think the recent code change does the trick for now.
Right now the follow message is output upon each package attach, regardless of whether the oauth credentials were cached in a prior session. This can be a bit confusing.
It would be nice if a message like that were output only if needed (e.g., if there are no cached credentials)
Additionally, it would be good to output something similar when a request returns an auth error such as:
ERROR: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.