MCPcopy Index your code
hub / github.com/coder/coder / wrapError

Method wrapError

coderd/externalauth/gitprovider/gitlab.go:585–592  ·  view source on GitHub ↗

wrapError converts library errors to our domain errors (e.g. rate limits).

(err error, action string)

Source from the content-addressed store, hash-verified

583
584// wrapError converts library errors to our domain errors (e.g. rate limits).
585func (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.
595func mapGitLabState(state string) PRState {

Callers 4

FetchPullRequestDiffMethod · 0.95
FetchBranchDiffMethod · 0.95

Calls 2

checkRateLimitErrorFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected