fix: security scanner warning noise: error handlers part 1 (#2141)

first group of error handlers to reduce security scanner warning noise level

Signed-off-by: Dave Lee <dave@gray101.com>
This commit is contained in:
Dave 2024-04-26 04:34:31 -04:00 committed by GitHub
parent 44bc540bb5
commit 2cd4936c99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 34 additions and 10 deletions

View file

@ -7,6 +7,7 @@ import (
"strings"
"github.com/go-skynet/LocalAI/pkg/downloader"
"github.com/rs/zerolog/log"
"github.com/go-skynet/LocalAI/pkg/assets"
"gopkg.in/yaml.v3"
@ -29,7 +30,10 @@ func ModelShortURL(s string) string {
}
func init() {
yaml.Unmarshal(modelLibrary, &modelShorteners)
err := yaml.Unmarshal(modelLibrary, &modelShorteners)
if err != nil {
log.Error().Err(err).Msg("error while unmarshalling embedded modelLibrary")
}
}
func GetRemoteLibraryShorteners(url string) (map[string]string, error) {