Merge pull request #1688 from tt/pass-through-known-errors

Pass through known errors
This commit is contained in:
Richard Scothern
2016-05-27 11:35:34 -07:00
4 changed files with 8 additions and 0 deletions

View File

@@ -634,6 +634,8 @@ func (app *App) dispatcher(dispatch dispatchFunc) http.Handler {
context.Errors = append(context.Errors, v2.ErrorCodeNameUnknown.WithDetail(err))
case distribution.ErrRepositoryNameInvalid:
context.Errors = append(context.Errors, v2.ErrorCodeNameInvalid.WithDetail(err))
case errcode.Error:
context.Errors = append(context.Errors, err)
}
if err := errcode.ServeJSON(w, context.Errors); err != nil {