X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/448c931a776c3e3f65ca2eab11da0c062d597818..2a528fe2981639cf099c713a6be16b8ea0e2cc67:/memory.go?ds=sidebyside diff --git a/memory.go b/memory.go index be58105..97be6a1 100644 --- a/memory.go +++ b/memory.go @@ -270,7 +270,12 @@ func (m *Memory) catchUp() error { } } - return m.save() + err := m.save() + if err != nil { + return fmt.Errorf("save caught-up memory: %w", err) + } + + return nil } // dispatch starts the builds that are ready, up to the limit. A build whose @@ -311,7 +316,12 @@ func (m *Memory) build(node Node) error { m.chat.Refresh(node) m.cview.Refresh(node) - return m.settle(NodeKey{node.Level, node.Index}) + err = m.settle(NodeKey{node.Level, node.Index}) + if err != nil { + return fmt.Errorf("settle built node: %w", err) + } + + return nil } // settle looks at the parent of the built node key when both children are