Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swarm: return errors on filtered addresses when dialing #2461

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

sukunrt
Copy link
Member

@sukunrt sukunrt commented Aug 7, 2023

Depends on #2460

This introduces a small breaking change. On no good addresses we previously used to return ErrNoGoodAddress not we return a *DialError which returns true on errors.Is(err, ErrNoGoodAddress)
This along with #2437 will allow us to check for all the reasons why dialing an address failed.

The minor breaking change is easy enough to remove but in this case it seems worth it since we are returning more information and also preserving existing behaviour, the only change required in existing code is using errors.Is instead of ==

@marten-seemann
Copy link
Contributor

Will review after #2460 has landed.

@marten-seemann marten-seemann self-requested a review August 14, 2023 03:49
@marten-seemann
Copy link
Contributor

@sukunrt Can you rebase this PR, so I can review it?

@sukunrt
Copy link
Member Author

sukunrt commented Aug 21, 2023

Fixed. Sorry, I didn't realise that the reqno removal PR changes caused conflicts here.

@marten-seemann marten-seemann changed the title swarm: return errors on filtered addresses when dialling swarm: return errors on filtered addresses when dialing Aug 21, 2023
@marten-seemann marten-seemann mentioned this pull request Aug 21, 2023
23 tasks
@marten-seemann
Copy link
Contributor

This introduces a small breaking change. On no good addresses we previously used to return ErrNoGoodAddress not we return a *DialError which returns true on errors.Is(err, ErrNoGoodAddress)

This is fine. You're not supposed to compare errors with == anyway.

@marten-seemann marten-seemann merged commit cd930fa into master Aug 25, 2023
12 checks passed
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.

2 participants