gogcli icon indicating copy to clipboard operation
gogcli copied to clipboard

Expired auth cookie gives unfriendly error message "json parsing error"

Open laurence-myers opened this issue 1 year ago • 1 comments

I ran gogcli update generate, and received this error message:

GetOwnedGames(page=1, search=) -> json parsing error: invalid character '<' looking for beginning of value

I guessed that it was failing to parse HTML, which in my experience is often returned by 400 or 401 HTTP responses. Sure enough, updating my cookie values fixed the error.

Would it be possible to give a more meaningful error message?

laurence-myers avatar Jul 20 '23 11:07 laurence-myers

Thanks for the report.

This is something I'll have a hard time reproducing to get the solution just right (ie, not saying its the cookie, when it is something else) until it happens to me, but I'll see if I can come up with something generic that makes sense.

At least, gogcli could inspect the status code of the response and output a more readable error message if its in the 4xx range (maybe "something is wrong with the request" for 400 and "something is wrong with the authentication, probably the cookie" for 401).

Magnitus- avatar Jul 22 '23 18:07 Magnitus-