From c4403cc4defa32af2410f1a2f1bd31ce1a358c41 Mon Sep 17 00:00:00 2001 From: Bas Stottelaar Date: Thu, 10 Sep 2015 20:05:02 +0200 Subject: [PATCH] Add logging to issue #2330. --- headphones/mb.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/headphones/mb.py b/headphones/mb.py index 0a477aa0..958245b7 100644 --- a/headphones/mb.py +++ b/headphones/mb.py @@ -99,6 +99,12 @@ def findArtist(name, limit=1): with mb_lock: try: artistResults = musicbrainzngs.search_artists(limit=limit, **criteria)['artist-list'] + except ValueError as e: + if "at least one query term is required" in e.message: + logger.error("Tried to search without a term, or an empty one. Provided artist (probably emtpy): %s", name) + return False + else: + raise except musicbrainzngs.WebServiceError as e: logger.warn('Attempt to query MusicBrainz for %s failed (%s)' % (name, str(e))) mb_lock.snooze(5)