Skip to content

Commit 38b5c12

Browse files
committed
fix: improve error handling in AddSketchLibrary by logging warnings instead of failing on library index update
1 parent e5a0282 commit 38b5c12

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/orchestrator/sketch_libs.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,11 @@ func AddSketchLibrary(ctx context.Context, app app.ArduinoApp, libRef LibraryRel
5050

5151
// update the local library_index if it is older than a certain threshold, to ensure the library is found when added by the arduino-cli
5252
stream, res := commands.UpdateLibrariesIndexStreamResponseToCallbackFunction(ctx, func(curr *rpc.DownloadProgress) {
53-
// TODO: show log progres ?
5453
slog.Debug("downloading library index", "progress", curr.Message)
5554
})
5655
req := &rpc.UpdateLibrariesIndexRequest{Instance: inst, UpdateIfOlderThanSecs: int64(indexUpdateInterval.Seconds())}
5756
if err := srv.UpdateLibrariesIndex(req, stream); err != nil {
58-
//TODO: only print a warn message instead of failing ?? The local-library could contain the lib even if the update fail
57+
//TODO: only print a warn message instead of failing ? in order to avoid blocking the user to instal lthe lib in case it is present into the local index
5958
return []LibraryReleaseID{}, fmt.Errorf("error updating library index: %v", err)
6059
}
6160
slog.Debug("Library index update", "status", res().GetLibrariesIndex().GetStatus())

0 commit comments

Comments
 (0)