Skip to content

Commit 534145d

Browse files
committed
Improve error handling in case of HTTP errors
In case of a HTTP status code 404, the returned 'r' was never assigned. In case of URL errors which are not timeouts, we probably should bail out.
1 parent fe162ee commit 534145d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

bin/github-backup

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,11 @@ def _get_response(request, auth, template):
304304
r = urllib2.urlopen(request)
305305
except urllib2.HTTPError as exc:
306306
errors, should_continue = _request_http_error(exc, auth, errors) # noqa
307+
r = exc
307308
except urllib2.URLError:
308309
should_continue = _request_url_error(template, retry_timeout)
310+
if not should_continue:
311+
raise
309312

310313
if should_continue:
311314
continue

0 commit comments

Comments
 (0)