wrap-cli icon indicating copy to clipboard operation
wrap-cli copied to clipboard

Better IPFS/ENS Error Handling (URI Resolution)

Open dOrgJelli opened this issue 3 years ago • 3 comments

Currently the error handling in the IPFS & ENS plugins is very poor when doing URI resolution.

Some conversation around this:

"worst part right now is if ens or ipfs resolver has an exception it will catch it and throw a generic "cant resolve" error" - @nerfZael

"I think it should be more specific about the reason why it couldn't resolve the wrapper (Ex: NetworkError, TimeoutError, FileNotFoundError, etc)" - @Niraj-Kamdar

"I'd even go a bit further and show the underlying error. We already catch it but then ignore/obfuscate it. Recently, while trying to figure out what signer to use for the ethereum plugin, I had to console log the error in the ens plugin just so I could see the actual error instead of the "Unable to resolve uri" error message" - @nerfZael

dOrgJelli avatar Feb 04 '22 17:02 dOrgJelli

One way to approach this is to modify the URI-Resolver interface to include errors in the return structure. Additionally we could define a known set of errors for common things, similar to HTTP response codes: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

dOrgJelli avatar Feb 04 '22 17:02 dOrgJelli

@nerfZael do you think this can be closed now that https://github.com/polywrap/toolchain/pull/1169 is merged?

dOrgJelli avatar Sep 21 '22 22:09 dOrgJelli

@nerfZael do you think this can be closed now that #1169 is merged?

No, handling the resolver extension errors will be a separate PR (similar to how resolver extension caching will be)

nerfZael avatar Sep 22 '22 10:09 nerfZael