Check if the given error string is an auth error, and if so returns the corresponding ErrXXX error, nil otherwise
(e string)
| 4161 | // Check if the given error string is an auth error, and if so returns |
| 4162 | // the corresponding ErrXXX error, nil otherwise |
| 4163 | func checkAuthError(e string) error { |
| 4164 | if strings.HasPrefix(e, AUTHORIZATION_ERR) { |
| 4165 | return ErrAuthorization |
| 4166 | } |
| 4167 | if strings.HasPrefix(e, AUTHENTICATION_EXPIRED_ERR) { |
| 4168 | return ErrAuthExpired |
| 4169 | } |
| 4170 | if strings.HasPrefix(e, AUTHENTICATION_REVOKED_ERR) { |
| 4171 | return ErrAuthRevoked |
| 4172 | } |
| 4173 | if strings.HasPrefix(e, ACCOUNT_AUTHENTICATION_EXPIRED_ERR) { |
| 4174 | return ErrAccountAuthExpired |
| 4175 | } |
| 4176 | return nil |
| 4177 | } |
| 4178 | |
| 4179 | // processErr processes any error messages from the server and |
| 4180 | // sets the connection's LastError. |
no outgoing calls
no test coverage detected