IsUnexpectedCloseError returns boolean indicating whether the error is a *CloseError with a code not in the list of expected codes.
(err error, expectedCodes ...int)
| 162 | // IsUnexpectedCloseError returns boolean indicating whether the error is a |
| 163 | // *CloseError with a code not in the list of expected codes. |
| 164 | func IsUnexpectedCloseError(err error, expectedCodes ...int) bool { |
| 165 | if e, ok := err.(*CloseError); ok { |
| 166 | for _, code := range expectedCodes { |
| 167 | if e.Code == code { |
| 168 | return false |
| 169 | } |
| 170 | } |
| 171 | return true |
| 172 | } |
| 173 | return false |
| 174 | } |
| 175 | |
| 176 | var ( |
| 177 | errWriteTimeout = &netError{msg: "websocket: write timeout", timeout: true, temporary: true} |
no outgoing calls