Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix an Error/Display impl#1262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

CobaltCause
Copy link
Contributor

Types implementing the Error trait should print some inner Errorxor return that inner Error from its Error::source impl. Otherwise, the same error will be printed multiple times when printing an Error's entire source chain, which is unhelpful.

paolobarbolini reacted with thumbs up emoji
@paolobarbolini
Copy link
Member

paolobarbolini commentedSep 20, 2025
edited
Loading

Could you rebase and fix tests?

Types implementing the Error trait should print some inner Error **xor**return that inner Error from its Error::source impl. Otherwise, the sameerror will be printed multiple times when printing an Error's entiresource chain, which is unhelpful.
@CobaltCause
Copy link
ContributorAuthor

Done.

Also FWIW, and I'm not 100% sure, but it seems like there might be another case of this kind of thing here:

#[derive(Debug)]
structConnectError{
error: ssl::Error,
verify_result:X509VerifyResult,
}
impl fmt::DisplayforConnectError{
fnfmt(&self,fmt:&mut fmt::Formatter<'_>) -> fmt::Result{
fmt::Display::fmt(&self.error, fmt)?;
ifself.verify_result !=X509VerifyResult::OK{
fmt.write_str(": ")?;
fmt::Display::fmt(&self.verify_result, fmt)?;
}
Ok(())
}
}
implErrorforConnectError{
fnsource(&self) ->Option<&(dynError +'static)>{
Some(&self.error)
}
}

@paolobarbolini
Copy link
Member

Also FWIW, and I'm not 100% sure, but it seems like there might be another case of this kind of thing here:

Correct that's another case of it. Would you like to send a PR about it?

Copy link
Member

@paolobarbolinipaolobarbolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for fixing this!

@paolobarbolinipaolobarbolini merged commitf34ed1b intorust-postgres:masterOct 7, 2025
4 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@paolobarbolinipaolobarbolinipaolobarbolini approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

tokio_postgres::Error duplicates cause's description
2 participants
@CobaltCause@paolobarbolini

[8]ページ先頭

©2009-2025 Movatter.jp