This commit is contained in:
Bruce MacDonald 2024-12-12 13:07:09 -08:00
parent 9e190ac4d9
commit e19c64e047
2 changed files with 3 additions and 4 deletions

View File

@ -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()

View File

@ -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