diff --git a/cmd/cmd.go b/cmd/cmd.go index 9a8d95a4d..0ba098462 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -587,7 +587,6 @@ func PushHandler(cmd *cobra.Command, args []string) error { } var ke api.ErrUnknownOllamaKey if errors.As(err, &ke) && isOllamaHost { - // the user has not added their ollama key to ollama.com // return an error with a more user-friendly message locals, _ := localPubKeys() diff --git a/server/routes.go b/server/routes.go index 848afe6e0..523fc9501 100644 --- a/server/routes.go +++ b/server/routes.go @@ -1561,11 +1561,11 @@ func newErr(err error) api.ErrorResponse { Message: err.Error(), } // Add additional error specific data, if any - var errResp api.ErrUnknownOllamaKey - if errors.As(err, &errResp) { + var keyErr api.ErrUnknownOllamaKey + if errors.As(err, &keyErr) { resp.Code = api.ErrCodeUnknownKey resp.Data = map[string]any{ - "key": errResp.Key, + "key": keyErr.Key, } } return resp