diff options
Diffstat (limited to 'client/src/leap/soledad')
-rw-r--r-- | client/src/leap/soledad/client/http_target/api.py | 6 |
1 files 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 |