IsHTTPError handles us being inconsistent with returning errors as values or pointers.
(err error)
| 225 | // IsHTTPError handles us being inconsistent with returning errors as values or |
| 226 | // pointers. |
| 227 | func IsHTTPError(err error) *HTTPError { |
| 228 | var httpErr HTTPError |
| 229 | if xerrors.As(err, &httpErr) { |
| 230 | return &httpErr |
| 231 | } |
| 232 | |
| 233 | var httpErrPtr *HTTPError |
| 234 | if xerrors.As(err, &httpErrPtr) { |
| 235 | return httpErrPtr |
| 236 | } |
| 237 | return nil |
| 238 | } |
| 239 | |
| 240 | // HTTPError is a helper struct for returning errors from the IDP sync process. |
| 241 | // A regular error is not sufficient because many of these errors are surfaced |