Skip to content

Commit 455742c

Browse files
author
Jack Diederich
committed
reraise HTTPErrors we don't handle and stop handling 404s
1 parent 04d53ca commit 455742c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

foauth2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,13 @@ def request(self, uri, body, headers, method='GET'):
186186
try:
187187
response = self._request(uri, body=body, headers=headers, method=method)
188188
except urllib2.HTTPError as e:
189-
if 400 <= e.code < 500:
189+
if 400 <= e.code < 500 and e.code != 404:
190190
# any 400 code is acceptable to signal that the access token is expired.
191191
self.refresh_access_token()
192192
headers['Authorization'] = 'Bearer %s' % self.access_token
193193
response = self._request(uri, body=body, headers=headers, method=method)
194+
else:
195+
raise
194196

195197
if response.code == 200:
196198
return simplejson.loads(response.read())

0 commit comments

Comments
 (0)