• Damien Neil's avatar
    all: add Unwrap and Is methods to various error types · 170b8b4b
    Damien Neil authored
    Add Unwrap methods to types which wrap an underlying error:
    
      "encodinc/csv".ParseError
      "encoding/json".MarshalerError
      "net/http".transportReadFromServerError
      "net".OpError
      "net".DNSConfigError
      "net/url".Error
      "os/exec".Error
      "signal/internal/pty".PtyError
      "text/template".ExecError
    
    Add os.ErrTemporary. A case could be made for putting this error
    value in package net, since no exported error types in package os
    include a Temporary method. However, syscall errors returned from
    the os package do include this method.
    
    Add Is methods to error types with a Timeout or Temporary method,
    making errors.Is(err, os.Err{Timeout,Temporary}) equivalent to
    testing the corresponding method:
    
      "context".DeadlineExceeded
      "internal/poll".TimeoutError
      "net".adrinfoErrno
      "net".OpError
      "net".DNSError
      "net/http".httpError
      "net/http".tlsHandshakeTimeoutError
      "net/pipe".timeoutError
      "net/url".Error
    
    Updates #30322
    Updates #29934
    
    Change-Id: I409fb20c072ea39116ebfb8c7534d493483870dc
    Reviewed-on: https://go-review.googlesource.com/c/go/+/170037
    Run-TryBot: Damien Neil <dneil@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarMarcel van Lohuizen <mpvl@golang.org>
    170b8b4b
Name
Last commit
Last update
..
example_test.go Loading commit data...
fuzz.go Loading commit data...
reader.go Loading commit data...
reader_test.go Loading commit data...
writer.go Loading commit data...
writer_test.go Loading commit data...