mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-30 23:44:59 +00:00
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:
parent
44bc540bb5
commit
2cd4936c99
7 changed files with 34 additions and 10 deletions
|
@ -3,10 +3,12 @@ package assets
|
|||
import (
|
||||
"embed"
|
||||
"io/fs"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
func ListFiles(content embed.FS) (files []string) {
|
||||
fs.WalkDir(content, ".", func(path string, d fs.DirEntry, err error) error {
|
||||
err := fs.WalkDir(content, ".", func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -18,5 +20,8 @@ func ListFiles(content embed.FS) (files []string) {
|
|||
files = append(files, path)
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error walking the embedded filesystem")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -131,10 +131,10 @@ func (s *server) PredictStream(in *pb.PredictOptions, stream pb.Backend_PredictS
|
|||
done <- true
|
||||
}()
|
||||
|
||||
s.llm.PredictStream(in, resultChan)
|
||||
err := s.llm.PredictStream(in, resultChan)
|
||||
<-done
|
||||
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *server) TokenizeString(ctx context.Context, in *pb.PredictOptions) (*pb.TokenizationResponse, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue