wrapError converts library errors to our domain errors (e.g. rate limits).
(err error, action string)
| 583 | |
| 584 | // wrapError converts library errors to our domain errors (e.g. rate limits). |
| 585 | func (g *gitlabProvider) wrapError(err error, action string) error { |
| 586 | if errResp, ok := errors.AsType[*gitlab.ErrorResponse](err); ok { |
| 587 | if rlErr := checkRateLimitError(errResp.Response, g.clock, "RateLimit-Reset"); rlErr != nil { |
| 588 | return rlErr |
| 589 | } |
| 590 | } |
| 591 | return xerrors.Errorf("gitlab %s: %w", action, err) |
| 592 | } |
| 593 | |
| 594 | // mapGitLabState maps a GitLab merge request state string to a normalized PRState. |
| 595 | func mapGitLabState(state string) PRState { |
no test coverage detected