registry/api: move all errors to "errcode" package

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2023-09-04 17:52:12 +02:00
parent a2e65220ae
commit 292e30bc61
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
13 changed files with 352 additions and 280 deletions

View file

@ -661,9 +661,9 @@ func (app *App) dispatcher(dispatch dispatchFunc) http.Handler {
switch err := err.(type) {
case distribution.ErrRepositoryUnknown:
context.Errors = append(context.Errors, v2.ErrorCodeNameUnknown.WithDetail(err))
context.Errors = append(context.Errors, errcode.ErrorCodeNameUnknown.WithDetail(err))
case distribution.ErrRepositoryNameInvalid:
context.Errors = append(context.Errors, v2.ErrorCodeNameInvalid.WithDetail(err))
context.Errors = append(context.Errors, errcode.ErrorCodeNameInvalid.WithDetail(err))
case errcode.Error:
context.Errors = append(context.Errors, err)
}