Skip to content
  • Gregory Szorc's avatar
    httppeer: wrap HTTPResponse.read() globally · bf855efe5664
    Gregory Szorc authored
    There were a handful of places in the code where HTTPResponse.read()
    was called with no explicit error handling or with inconsistent
    error handling. In order to eliminate this class of bug, we globally
    swap out HTTPResponse.read() with a unified error handler.
    
    I initially attempted to fix all call sites. However, after
    going down that rabbit hole, I figured it was best to just change
    read() to do what we want. This appears to be a worthwhile
    change, as the tests demonstrate many of our uncaught exceptions
    go away.
    
    To better represent this class of failure, we introduce a new
    error type. The main benefit over IOError is it can hold a hint.
    I'm receptive to tweaking its name or inheritance.
    bf855efe5664