Skip to content

transaction: preserve the error chain in wrapTransportError - #322

Open
Mliviu79 wants to merge 1 commit into
emiago:mainfrom
Mliviu79:pr/transport-error-chain
Open

transaction: preserve the error chain in wrapTransportError#322
Mliviu79 wants to merge 1 commit into
emiago:mainfrom
Mliviu79:pr/transport-error-chain

Conversation

@Mliviu79

Copy link
Copy Markdown
Contributor

Fixes #321

wrapTransportError rendered the cause with %s, so only ErrTransactionTransport stayed matchable and the underlying write or dial failure was unreachable through errors.Is and errors.As.

The cause is wrapped with %w instead. Matching on ErrTransactionTransport is unchanged — the added test asserts both.

wrapTransportError rendered the cause with %s, so only ErrTransactionTransport
stayed matchable and the underlying write or dial failure was unreachable
through errors.Is and errors.As. The cause is wrapped with %w instead.

Matching on ErrTransactionTransport is unchanged.

Refs emiago#321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sip: wrapTransportError flattens the cause

1 participant