IsCloseError returns boolean indicating whether the error is a *CloseError with one of the specified codes.
(err error, codes ...int)
| 149 | // IsCloseError returns boolean indicating whether the error is a *CloseError |
| 150 | // with one of the specified codes. |
| 151 | func IsCloseError(err error, codes ...int) bool { |
| 152 | if e, ok := err.(*CloseError); ok { |
| 153 | for _, code := range codes { |
| 154 | if e.Code == code { |
| 155 | return true |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | return false |
| 160 | } |
| 161 | |
| 162 | // IsUnexpectedCloseError returns boolean indicating whether the error is a |
| 163 | // *CloseError with a code not in the list of expected codes. |
no outgoing calls