From 289fc2b69a16a38c422a94b9c49ddb07c6e601b0 Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Sat, 17 Aug 2024 17:57:39 +0300 Subject: [PATCH] chore: log error when saving state fails --- cmd/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/main.go b/cmd/main.go index 7d0dc58..6219580 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -59,7 +59,6 @@ type fsData struct { func (fsd *fsData) SetLanguageSelected(ctx context.Context, sym string, input []byte) (resource.Result, error) { inputStr := string(input) res := resource.Result{} - switch inputStr { case "0": res.FlagSet = []uint32{state.FLAG_LANG} @@ -257,6 +256,9 @@ func main() { if err != nil { pr = pr.WithContent(&st, ca) err = pr.Save(cfg.SessionId) + if err != nil { + fmt.Fprintf(os.Stderr, "Failed to save state with error: %v\n", err) + } en, err = engine.NewPersistedEngine(ctx, cfg, pr, rfs) if err != nil { fmt.Fprintf(os.Stderr, "engine create exited with error: %v\n", err)