Skip to content

Commit

Permalink
Improve an error message
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed Oct 2, 2024
1 parent 28e0bdf commit ee020a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v2/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package ollamaclient

import (
"encoding/base64"
"errors"
"fmt"
"os"
)

Expand All @@ -13,7 +13,7 @@ func Base64EncodeFile(filePath string) (string, error) {
return "", err
}
if len(data) == 0 {
return "", errors.New(filePath + " is empty")
return "", fmt.Errorf("%s contains 0 bytes", filePath)
}
encoded := base64.StdEncoding.EncodeToString(data)
return encoded, nil
Expand Down

0 comments on commit ee020a0

Please sign in to comment.