multi: wrap all errors

This commit is contained in:
Oliver Gugger
2024-03-07 13:19:28 +01:00
committed by Andras Banki-Horvath
parent 9a28a4c105
commit 648fb22f63
60 changed files with 138 additions and 133 deletions

View File

@@ -475,7 +475,7 @@ func (n *sessionNegotiator) tryAddress(sessionKey keychain.SingleKeyECDH,
err = n.cfg.DB.CreateClientSession(dbClientSession)
if err != nil {
return fmt.Errorf("unable to persist ClientSession: %v",
return fmt.Errorf("unable to persist ClientSession: %w",
err)
}

View File

@@ -527,7 +527,7 @@ func (q *sessionQueue) nextStateUpdate() (*wtwire.StateUpdate, bool,
hint, encBlob, err := task.craftSessionPayload(q.cfg.Signer)
if err != nil {
// TODO(conner): mark will not send
err := fmt.Errorf("unable to craft session payload: %v",
err := fmt.Errorf("unable to craft session payload: %w",
err)
return nil, false, wtdb.BackupID{}, err
}
@@ -665,7 +665,7 @@ func (q *sessionQueue) sendStateUpdate(conn wtserver.Peer,
switch {
case err == wtdb.ErrUnallocatedLastApplied:
// TODO(conner): borked watchtower
err = fmt.Errorf("unable to ack seqnum=%d: %v",
err = fmt.Errorf("unable to ack seqnum=%d: %w",
stateUpdate.SeqNum, err)
q.log.Errorf("SessionQueue(%v) failed to ack update: %v",
q.ID(), err)
@@ -673,14 +673,14 @@ func (q *sessionQueue) sendStateUpdate(conn wtserver.Peer,
case err == wtdb.ErrLastAppliedReversion:
// TODO(conner): borked watchtower
err = fmt.Errorf("unable to ack seqnum=%d: %v",
err = fmt.Errorf("unable to ack seqnum=%d: %w",
stateUpdate.SeqNum, err)
q.log.Errorf("SessionQueue(%s) failed to ack update: %v",
q.ID(), err)
return err
case err != nil:
err = fmt.Errorf("unable to ack seqnum=%d: %v",
err = fmt.Errorf("unable to ack seqnum=%d: %w",
stateUpdate.SeqNum, err)
q.log.Errorf("SessionQueue(%s) failed to ack update: %v",
q.ID(), err)