Untrapped exception in response to IMDB metadata search

Just a minor bug noticed reading the logs and found this where MCEBuddy parses the response to the IMDB search API call. Should be an easy trap or check to suppress. Likely that is the expected response when the connection timesout or maybe an empty response.

--> Searching IMDB for Series Title match
WARNING> --> Error parsing IMDB Show response
Error -> System.NullReferenceException: Object reference not set to an instance of an object.
   at MCEBuddy.MetaData.IMDB.SearchShowTitle(String title, Nullable`1 releaseDate, ShowType matchType, Boolean firstMatchOnly, Boolean searchAKAs, Log jobLog)
--> IMDB search titles found -> 0

It intentional to capture the root issue where a look up fails unexpectedly. Often this is caused by missing information.

So what, exactly does that error tell us about the root cause? The important bits in really identifying the root cause of the failure are the parameter values passed to that function, not the signature of the function.

And yes, I know it requires some extra work because Java/C#/Python/etc. are all brain-dead about error messages, the worst of which is the “ClassNotFound” error, where the message fails to tell anyone which class was not found. ProTip: look up the Pragmatic Programmer series on Java and how they resolve the ClassNotFound error by overriding the ClassLoader class - pretty slick. It might take some monkeying with the Exception handling to extend/override the Exception, spit out the parameters in the MCEBuddy log and then re-throw the original exception.

Similarly, in this case, we don’t know which parameter caused the failure (or whether it was a simple network timeout) or if there was an API failure with an error code. Although if there is an error like we’re seeing here and not an error code returned by the API call, then that should be a (minor) coding issue on the MCEBuddy side, not a lack of response on the API service side (as that would be an expected (empty) non-response response - i.e. this null response from the API).

So what is the root cause, then?

It tells us (developers) that the AKA information MCEBuddy was expecting on the lookup site doesn’t exist (it’s supposed to, but is missing).