From 739fa78ad984836ed2d16e16850cc46b4c40748d Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 13 Mar 2017 16:16:33 +0100 Subject: [bug] fix raising of invalid auth token error --- client/src/leap/soledad/client/http_target/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/leap/soledad/client/http_target/api.py b/client/src/leap/soledad/client/http_target/api.py index 1b086a00..fc65c9bd 100644 --- a/client/src/leap/soledad/client/http_target/api.py +++ b/client/src/leap/soledad/client/http_target/api.py @@ -21,13 +21,13 @@ import base64 from StringIO import StringIO from uuid import uuid4 -from twisted.web.error import Error from twisted.internet import defer from twisted.web.http_headers import Headers from twisted.web.client import FileBodyProducer from leap.soledad.client.http_target.support import readBody from leap.soledad.common.errors import InvalidAuthTokenError +from leap.soledad.common.l2db.errors import HTTPError from leap.soledad.common.l2db import SyncTarget @@ -242,7 +242,7 @@ def _unauth_to_invalid_token_error(failure): :return: Either the original failure or an invalid auth token error. :rtype: twisted.python.failure.Failure """ - failure.trap(Error) - if failure.getErrorMessage() == "401 Unauthorized": + failure.trap(HTTPError) + if failure.value.status == 401: raise InvalidAuthTokenError return failure -- cgit v1.2.3