Skip to content

Re-export url::ParseError alongside url::Url#1033

Open
eyupcanakman wants to merge 1 commit into
cloudflare:mainfrom
eyupcanakman:reexport-url-parse-error
Open

Re-export url::ParseError alongside url::Url#1033
eyupcanakman wants to merge 1 commit into
cloudflare:mainfrom
eyupcanakman:reexport-url-parse-error

Conversation

@eyupcanakman

Copy link
Copy Markdown
Contributor

Url::parse returns Result<Url, ParseError> and Error already has a From<url::ParseError> impl, but only Url is re-exported. Naming the error type means taking a direct dependency on url.

Re-exports it alongside Url (pub use url::{ParseError, Url};), with a trybuild pass test next to the start-handler.rs one from #974.

Adding ParseError at the root can conflict under use worker::* if chrono's ParseError is also in scope via *, though I didn't find a public crate doing that and an explicit import clears it. Given #890, I can re-export the url module for worker::url::ParseError instead if you'd prefer.

Closes #380.

`Url::parse` returns `Result<Url, ParseError>` and `Error` already has a `From<url::ParseError>` impl, but the error type itself was never re-exported. Naming it meant taking a direct dependency on `url`.

Closes cloudflare#380.
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.

[BUG] ParseError is not exported from url crate when implementing From<ParseError> for CustomError

1 participant