mirror of https://github.com/golang/go.git
net/http: push roundTrip panic higher in the stack
If Transport is a non-nil interface pointing to a nil implementer, then a panic inside of roundTrip further obsfucates the issue. Change-Id: I47664b8e6185c5f56b5e529f49022484b5ea1d94 Reviewed-on: https://go-review.googlesource.com/c/go/+/661897 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Neal Patel <nealpatel@google.com> Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
parent
ec4a9fb321
commit
53badd4836
|
|
@ -27,5 +27,8 @@ func badRoundTrip(*Transport, *Request) (*Response, error)
|
||||||
// Like the RoundTripper interface, the error types returned
|
// Like the RoundTripper interface, the error types returned
|
||||||
// by RoundTrip are unspecified.
|
// by RoundTrip are unspecified.
|
||||||
func (t *Transport) RoundTrip(req *Request) (*Response, error) {
|
func (t *Transport) RoundTrip(req *Request) (*Response, error) {
|
||||||
|
if t == nil {
|
||||||
|
panic("transport is nil")
|
||||||
|
}
|
||||||
return t.roundTrip(req)
|
return t.roundTrip(req)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue