MCPcopy Create free account
hub / github.com/gogs/gogs / HandleCheckKeyStringError

Function HandleCheckKeyStringError

internal/route/api/v1/repo/key.go:62–68  ·  view source on GitHub ↗
(c *context.APIContext, err error)

Source from the content-addressed store, hash-verified

60}
61
62func HandleCheckKeyStringError(c *context.APIContext, err error) {
63 if database.IsErrKeyUnableVerify(err) {
64 c.ErrorStatus(http.StatusUnprocessableEntity, errors.New("Unable to verify key content"))
65 } else {
66 c.ErrorStatus(http.StatusUnprocessableEntity, errors.Wrap(err, "Invalid key content: %v"))
67 }
68}
69
70func HandleAddKeyError(c *context.APIContext, err error) {
71 switch {

Callers 2

CreateUserPublicKeyFunction · 0.92
CreateDeployKeyFunction · 0.85

Calls 2

IsErrKeyUnableVerifyFunction · 0.92
ErrorStatusMethod · 0.80

Tested by

no test coverage detected