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

Function IsUnauthorizedError

coderd/httpapi/httpapi.go:133–144  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

131}
132
133func IsUnauthorizedError(err error) bool {
134 if err == nil {
135 return false
136 }
137
138 // This tests for dbauthz.IsNotAuthorizedError and rbac.IsUnauthorizedError.
139 var unauthorized httpapiconstraints.IsUnauthorizedError
140 if errors.As(err, &unauthorized) && unauthorized.IsUnauthorized() {
141 return true
142 }
143 return false
144}
145
146// Convenience error functions don't take contexts since their responses are
147// static, it doesn't make much sense to trace them.

Callers 10

fetchSnapshotTaskLogsMethod · 0.92
agentGitSSHKeyMethod · 0.92
postUserSkillMethod · 0.92
patchUserSkillMethod · 0.92
idpSyncClaimFieldsMethod · 0.92
deleteOrgRoleMethod · 0.92
Is404ErrorFunction · 0.70

Calls 2

IsUnauthorizedMethod · 0.95
AsMethod · 0.80

Tested by

no test coverage detected