Closed GeorgeFive closed 3 months ago
I'll try to add id to Uncaught Exception
Do you want this added to logger as well?
@GeorgeFive I added id to Exception, could you test if this works?
I'll keep an eye on the log and let you know how it works. It happens randomly, so I can't force a test on it, just have to wait and see. Sometimes [name], sometimes [data], sometimes 5-10 a day, sometimes none. Thanks!
PHP Fatal error: Uncaught Exception: Failed to retrieve query [Name] , IMDb id [nm0411150]
Looks good, thanks!
Nice, now we have to find out what went wrong? If i test this id it works fine
It might be too many connections in a time, IMDb does throttle requests, although i didn't experience this jet. My use case is different of course
I'm pretty sure it wasn't the class, just imdb giving an error. I store all names in my database with a date_checked field, then run a cron to grab the oldest checked names and rescan them for updated pics and info. I do sleep() in between names, but I guess sometimes it chokes anyway.
Ah that make sence, so this one can be closed
Hey, would it be possible to update graphql.php to include details on which id failed? Example, I've got a few variations of these in my error log:
[24-Aug-2024 07:11:19 EST] PHP Fatal error: Uncaught Exception: Failed to retrieve query [Name] in imdb6/src/Imdb/GraphQL.php:100 Stack trace: 0 imdb6/src/Imdb/GraphQL.php(61): Imdb\GraphQL->doRequest('query Name($id:...', 'Name', Array) 1 imdb6/src/Imdb/Name.php(92): Imdb\GraphQL->query('query Name($id:...', 'Name', Array) 2 cron/get_cast_dates.php(22): Imdb\Name->name() 3 {main} thrown in imdb6/src/Imdb/GraphQL.php on line 100
This is not a problem with the class itself, I think imdb just didn't work in this particular instance for whatever reason, but it would be nice to know which ID it choked on so I could double check it and maybe manually refresh it if needed?
Maybe a log entry like - Uncaught Exception: Failed to retrieve query [Name] in nm0123456