| 512 | } |
| 513 | |
| 514 | func (e proxyError) Error() string { |
| 515 | if e.err != nil { |
| 516 | return fmt.Sprintf("dialing failed %v: %v", e.DialError(), e.err.Error()) |
| 517 | } |
| 518 | |
| 519 | if e.handled { |
| 520 | return "request handled in a non-standard way" |
| 521 | } |
| 522 | |
| 523 | code := e.code |
| 524 | if code == 0 { |
| 525 | code = http.StatusInternalServerError |
| 526 | } |
| 527 | |
| 528 | return fmt.Sprintf("proxy error: %d", code) |
| 529 | } |
| 530 | |
| 531 | // DialError returns true if the error was caused while dialing TCP or |
| 532 | // TLS connections, before HTTP data was sent. It is safe to retry |