- Notifications
You must be signed in to change notification settings - Fork514
Closed
Description
I think it's too late to change now, but just wanted to mention.
Sincetokio_postgres::Error
duplicates itscause
in Display:
if let Some(ref cause) = self.0.cause { write!(fmt, ": {}", cause)?;}
... this means that things likeanyhow::Error
(with:#
) that walk the cause chain and concatenate the description will duplicate the message, e.g.:
db error: ERROR: syntax error at or near "SELECTa": ERROR: syntax error at or near "SELECTa"
Ideally, it would either
- include
cause
and only print things relevant to itself in the description, or - not include cause, and include it in its own description, or
- support both modes like
anyhow::Error
(concatenate only in alternate mode).
Metadata
Metadata
Assignees
Labels
No labels