musicbrainz/picard — pull request #38 by brianfreud (2012-05-06 05:26:19+00:00)
Title: Silence errors that flood the logs when an accoustid fingerprint has no match returned.

When an accoustid fingerprint lookup request fails, due to there being no match at the server, each one generates a lot of error text in the logs:

Traceback (most recent call last):
File "./picard/webservice.py", line 209, in _process_reply
handler(xml_handler.document, reply, error)
File "./picard/acoustid.py", line 92, in _on_lookup_finished
results = document.response[0].results[0].children.get('result')
File "./picard/webservice.py", line 76, in __getattr__
raise AttributeError, name
AttributeError: response

This isn't really useful; we know exactly why the lookup failed, and it's entirely the expected behaviour by Picard. So this patch silences that error. If a lookup fails because there is no match, then there really is no error, but rather, we tried, we failed to find a match, and all is as expected. There is not, however, a code bug which should then expose the failure to the logs. (And typically, if you're doing a batch lookup, this creates a LOT of useless log text.)