Fix handling URLErrors in GitHub without an HTTP status code.

Review Request #13303 — Created Oct. 4, 2023 and submitted

Information

Review Board
release-6.x

Reviewers

The HTTP error handler in GitHub was assuming that error classes always
had an HTTP status code, but this is only the case for HTTPError and
not URLError. If an error occurs due to an outage or something other
than an HTTP response, we'd crash.

This fixes the code to provide an HTTP status code only if it exists on
the error object.

Turned off wifi and attempted to load a diff locally. Saw an error about
issues accessing the file, rather than a crash traceback.

Summary ID
Fix handling URLErrors in GitHub without an HTTP status code.
The HTTP error handler in GitHub was assuming that error classes always had an HTTP status code, but this is only the case for `HTTPError` and not `URLError`. If an error occurs due to an outage or something other than an HTTP response, we'd crash. This fixes the code to provide an HTTP status code only if it exists on the error object.
0fb481a67ee1de5f2a863d1da9dc20d2d0976a52
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-6.x (36afcaa)
Loading...