MCPcopy Create free account
hub / github.com/marmotedu/iam / init

Function init

internal/pkg/code/code_generated.go:10–38  ·  view source on GitHub ↗

init register error codes defines in this source code to `github.com/marmotedu/errors`

()

Source from the content-addressed store, hash-verified

8
9// init register error codes defines in this source code to `github.com/marmotedu/errors`
10func init() {
11 register(ErrUserNotFound, 404, "User not found")
12 register(ErrUserAlreadyExist, 400, "User already exist")
13 register(ErrReachMaxCount, 400, "Secret reach the max count")
14 register(ErrSecretNotFound, 404, "Secret not found")
15 register(ErrPolicyNotFound, 404, "Policy not found")
16 register(ErrSuccess, 200, "OK")
17 register(ErrUnknown, 500, "Internal server error")
18 register(ErrBind, 400, "Error occurred while binding the request body to the struct")
19 register(ErrValidation, 400, "Validation failed")
20 register(ErrTokenInvalid, 401, "Token invalid")
21 register(ErrPageNotFound, 404, "Page not found")
22 register(ErrDatabase, 500, "Database error")
23 register(ErrEncrypt, 401, "Error occurred while encrypting the user password")
24 register(ErrSignatureInvalid, 401, "Signature is invalid")
25 register(ErrExpired, 401, "Token expired")
26 register(ErrInvalidAuthHeader, 401, "Invalid authorization header")
27 register(ErrMissingHeader, 401, "The `Authorization` header was empty")
28 register(ErrPasswordIncorrect, 401, "Password was incorrect")
29 register(ErrPermissionDenied, 403, "Permission denied")
30 register(ErrEncodingFailed, 500, "Encoding failed due to an error with the data")
31 register(ErrDecodingFailed, 500, "Decoding failed due to an error with the data")
32 register(ErrInvalidJSON, 500, "Data is not valid JSON")
33 register(ErrEncodingJSON, 500, "JSON data could not be encoded")
34 register(ErrDecodingJSON, 500, "JSON data could not be decoded")
35 register(ErrInvalidYaml, 500, "Data is not valid Yaml")
36 register(ErrEncodingYaml, 500, "Yaml data could not be encoded")
37 register(ErrDecodingYaml, 500, "Yaml data could not be decoded")
38}

Callers

nothing calls this directly

Calls 1

registerFunction · 0.85

Tested by

no test coverage detected