From d406d554f22427f9f2a3167ab73667caf0d80b89 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 7 Jul 2011 08:20:43 -0700 Subject: [PATCH] reorder exception handlers --- beets/autotag/mb.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index 0f8fcc57d..097840f85 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -86,6 +86,13 @@ def _query_wrap(fun, *args, **kwargs): try: # Try the function. res = fun(*args, **kwargs) + except mbws.ConnectionError: + # Typically a timeout. + pass + except mbws.ResponseError, exc: + # Malformed response from server. + log.error('Bad response from MusicBrainz: ' + str(exc)) + raise BadResponseError() except mbws.WebServiceError, e: # Server busy. Retry. message = str(e.reason) @@ -95,13 +102,6 @@ def _query_wrap(fun, *args, **kwargs): else: # This is not the error we're looking for. raise - except mbws.ConnectionError: - # Typically a timeout. - pass - except mbws.ResponseError, exc: - # Malformed response from server. - log.error('Bad response from MusicBrainz: ' + str(exc)) - raise BadResponseError() else: # Success. Return the result. return res