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

Make decapsulate return an error if the protocol is not found #15

Closed
progval opened this issue Sep 17, 2016 · 6 comments
Closed

Make decapsulate return an error if the protocol is not found #15

progval opened this issue Sep 17, 2016 · 6 comments

Comments

@progval
Copy link
Contributor

progval commented Sep 17, 2016

The doc of decapsulate currently reads: “Returns the original if the passed in address is not found”.

Could you change the behavior of decapsulate to return an error of the protocol is not found? This way we have a way to know the protocol was not in the multiaddr.
Additionally, it forces users of decapsulate to explicitly handle this case when calling it.

@dignifiedquire
Copy link
Member

Sounds good.

@deg4uss3r
Copy link

Old issue but I might be able to help here, if this hasn’t been handled yet. :)

@dignifiedquire
Copy link
Member

@deg4uss3r I don't think this has been handled yet, but you might want to look at #25 first which changes a lot of things around

@deg4uss3r
Copy link

Cool! I’ll hold off until that’s merged in.

@ntninja
Copy link

ntninja commented Nov 7, 2017

If this is wanted I can easily add change the final Ok(self.clone()) line in the decapsulate method of my PR to Err(…). I only thought that it may break backcompat, so I didn't do that yet.

@mxinden
Copy link
Member

mxinden commented May 26, 2021

Closing here since decapsule has been removed in #40 in favor of basic iteration. Please speak up in case you would like to continue the discussion.

@mxinden mxinden closed this as completed May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants