viem icon indicating copy to clipboard operation
viem copied to clipboard

feat(errors): add url to request errors

Open bearpong opened this issue 1 year ago • 3 comments

In order to help better error handling, url is added as property on request errors.

This helps project understand which rpc failed. This is important as clients might be using fallback as transport without knowing which rpc is actually being used and which one is throwing timeout or http errors.

This makes all errors consistent with HttpRequestError that exposes the url as class property.

bearpong avatar Oct 31 '25 16:10 bearpong

🦋 Changeset detected

Latest commit: 366f545c533fb8e249207734f62130b82df5053a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Oct 31 '25 16:10 changeset-bot[bot]

Open in StackBlitz

npm i https://pkg.pr.new/viem@4069

commit: 0ba6d17

pkg-pr-new[bot] avatar Oct 31 '25 16:10 pkg-pr-new[bot]

@jxom any chance to review this? It's an easy one, it just bubbles up more info in errors.

bearpong avatar Nov 04 '25 17:11 bearpong