Skip to content

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

Merged
guybedford merged 2 commits into
cloudflare:mainfrom
eyupcanakman:reexport-url-parse-error
Aug 18, 2026
Merged

Re-export url::ParseError alongside url::Url#1033
guybedford merged 2 commits 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.

eyupcanakman and others added 2 commits July 13, 2026 14:38
`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.
@guybedford

Copy link
Copy Markdown
Collaborator

Thanks for the PR! I changed this to reexport url directly rather, so it becomes url::ParseError instead - clarifying the namespacing and better supporting further similar issues.

@guybedford
guybedford enabled auto-merge (squash) August 18, 2026 18:32
@guybedford
guybedford disabled auto-merge August 18, 2026 18:32
@guybedford
guybedford enabled auto-merge (squash) August 18, 2026 18:33
@codspeed-hq

codspeed-hq Bot commented Aug 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 2 untouched benchmarks


Comparing eyupcanakman:reexport-url-parse-error (ca85855) with main (78dc0cd)

Open in CodSpeed

@guybedford
guybedford merged commit eb2a36b into cloudflare:main Aug 18, 2026
11 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.

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

2 participants