René's URL Explorer Experiment


Title: Export a guard for `VoidActionError` at every status · Issue #714 · voidzero-dev/void · GitHub

Open Graph Title: Export a guard for `VoidActionError` at every status · Issue #714 · voidzero-dev/void

X Title: Export a guard for `VoidActionError` at every status · Issue #714 · voidzero-dev/void

Description: Summary Follow-up to #680, as #691 suggested ("that can be a separate change"). Since 1.6.0, a 4xx action error's message is the server's text, thanks for that. #680's other ask is still open: a guard that recognises a VoidActionError at...

Open Graph Description: Summary Follow-up to #680, as #691 suggested ("that can be a separate change"). Since 1.6.0, a 4xx action error's message is the server's text, thanks for that. #680's other ask is still open: a gu...

X Description: Summary Follow-up to #680, as #691 suggested ("that can be a separate change"). Since 1.6.0, a 4xx action error's message is the server's text, thanks for that. #680's other a...

Opengraph URL: https://github.com/voidzero-dev/void/issues/714

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Export a guard for `VoidActionError` at every status","articleBody":"### Summary\n\nFollow-up to #680, as [#691](https://github.com/voidzero-dev/void/pull/691) suggested (\"that can be a separate change\"). Since 1.6.0, a 4xx action error's `message` is the server's text, thanks for that. #680's other ask is still open: a guard that recognises a `VoidActionError` at every status.\n\nThe [actions guide](https://github.com/voidzero-dev/void/blob/main/docs/guide/pages-routing/actions-and-forms.md) says 401, 403 and 5xx are thrown, and to \"handle them with your framework's error boundary\". But the only guard Void exports, `isCallSiteActionError()`, is `false` for exactly those statuses. So an error boundary can't tell an action error from any other error without reproducing Void's internals.\n\n### Reproduction\n\n```ts\n// pages/notes.server.ts\nimport { HTTPException } from 'hono/http-exception';\nimport { defineHandler } from 'void';\n\nexport const action = defineHandler(async (c) => {\n  const status = Number(c.req.query('status'));\n  throw new HTTPException(status as 403, { message: 'You can vote once your account is a day old' });\n});\n```\n\n```ts\n// pages/notes.tsx\nimport { isCallSiteActionError } from 'void/pages-client';\n\ntry {\n  await action(`/notes?status=${status}`, { data: {} });\n} catch (error) {\n  isCallSiteActionError(error); // false for 401, 403 and 5xx\n}\n```\n\n| Status | `action()` | `error.name`      | `isCallSiteActionError()` |\n| ------ | ---------- | ----------------- | ------------------------- |\n| 409    | returns    | `VoidActionError` | `true`                    |\n| 401    | throws     | `VoidActionError` | `false`                   |\n| 403    | throws     | `VoidActionError` | `false`                   |\n| 500    | throws     | `VoidActionError` | `false`                   |\n\n### Why it matters\n\n- **The boundary the docs point to has no guard.** It has to tell an action error from a render bug to show a 403's message, send a 401 to login, or show a generic message for a 500.\n- **Every app copies the guard's internals.** `instanceof VoidActionError` isn't reliable when the class is bundled more than once, which is why `isCallSiteActionError()` checks `error.name`. Apps do the same by hand, relying on a class name the docs never mention.\n- **Neither exported helper is documented.** `isCallSiteActionError()` and `categorizeActionError()` are exported from `void/pages-client` but don't appear in the guide or the API reference.\n\n### Proposal\n\n1. Export `isVoidActionError()` next to `isCallSiteActionError()`, true for every status:\n\n   ```ts\n   export function isVoidActionError(error: unknown): error is VoidActionError {\n     return (\n       typeof error === 'object' &&\n       error !== null &&\n       'name' in error &&\n       error.name === 'VoidActionError' &&\n       'status' in error &&\n       typeof error.status === 'number'\n     );\n   }\n\n   export function isCallSiteActionError(error: unknown): error is VoidActionError {\n     return isVoidActionError(error) && categorizeActionError(error.status) === 'callSite';\n   }\n   ```\n\n2. Document both guards in the actions guide, next to the paragraph on thrown errors.\n\n### Prior art\n\n- **React Router:** `isRouteErrorResponse(error)` recognises a thrown response in an error boundary, at any status.\n- **SvelteKit:** `isHttpError(error, status?)` recognises an `error()` at any status, or a given one.\n\n### Workaround\n\n```ts\n// By name: instanceof fails across bundled copies.\nexport function isActionError(error: unknown): error is VoidActionError {\n  return error instanceof Error && error.name === 'VoidActionError';\n}\n```\n\n### Environment\n\n- `void` 1.6.1\n- `@void/react` 1.6.1\n","author":{"url":"https://github.com/karthickeyan-dev","@type":"Person","name":"karthickeyan-dev"},"datePublished":"2026-11-04T15:48:55Z","url":"https://github.com/voidzero-dev/void/issues/714"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:756039d4-446e-d44a-389a-7515dcf028eb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDA06:243829:1ED496:2A619D:6AFBFFC2
html-safe-nonce289d2fee47bc8c73579e6ac80bdaeee5d0d209ddd816b1fa3fa4902b32cbf603
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTA2OjI0MzgyOToxRUQ0OTY6MkE2MTlEOjZBRkJGRkMyIiwidmlzaXRvcl9pZCI6IjU4Mjc1MTc5NjgxMDI5ODE1NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac01a8414eca2b2c4f6671e9c635df9a21631cb43f449a8b276c11e17afc8104be
hovercard-subject-tagissue:6206236058
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/voidzero-dev/void/714/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0e6c5e89c5f700ead7efbb30ab35befb724392185b682c6d54d7c0b8f1149768/voidzero-dev/void/issues/714
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0e6c5e89c5f700ead7efbb30ab35befb724392185b682c6d54d7c0b8f1149768/voidzero-dev/void/issues/714
og:image:altSummary Follow-up to #680, as #691 suggested ("that can be a separate change"). Since 1.6.0, a 4xx action error's message is the server's text, thanks for that. #680's other ask is still open: a gu...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekarthickeyan-dev
hostnamegithub.com
expected-hostnamegithub.com
Nonefa74413a1d84dac536fcca0740780bcbd3207bafec0e51873b73ff8e8cca032f
turbo-cache-controlno-preview
go-importgithub.com/voidzero-dev/void git https://github.com/voidzero-dev/void.git
octolytics-dimension-user_id149750581
octolytics-dimension-user_loginvoidzero-dev
octolytics-dimension-repository_id1164437080
octolytics-dimension-repository_nwovoidzero-dev/void
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1164437080
octolytics-dimension-repository_network_root_nwovoidzero-dev/void
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb3b5633a74535d9c23385512d534c66c8fde1907
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/voidzero-dev/void/issues/714#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvoidzero-dev%2Fvoid%2Fissues%2F714
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvoidzero-dev%2Fvoid%2Fissues%2F714
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=voidzero-dev%2Fvoid
Reloadhttps://github.com/voidzero-dev/void/issues/714
Reloadhttps://github.com/voidzero-dev/void/issues/714
Reloadhttps://github.com/voidzero-dev/void/issues/714
voidzero-devhttps://github.com/voidzero-dev
voidhttps://github.com/voidzero-dev/void
Codehttps://github.com/voidzero-dev/void
Issues31 (31)https://github.com/voidzero-dev/void/issues
Pull requests11 (11)https://github.com/voidzero-dev/void/pulls
Discussionshttps://github.com/voidzero-dev/void/discussions
Actionshttps://github.com/voidzero-dev/void/actions
Security and qualityhttps://github.com/voidzero-dev/void/security
Insightshttps://github.com/voidzero-dev/void/pulse
https://github.com/voidzero-dev/void
New issuehttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/714
New issuehttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/714
#715https://github.com/voidzero-dev/void/pull/715
Export a guard for VoidActionError at every statushttps://github.com/voidzero-dev/void/issues/714#top
#715https://github.com/voidzero-dev/void/pull/715
https://github.com/karthickeyan-dev
karthickeyan-devhttps://github.com/karthickeyan-dev
on Nov 4, 2026https://github.com/voidzero-dev/void/issues/714#issue-6206236058
#680https://github.com/voidzero-dev/void/issues/680
#691https://github.com/voidzero-dev/void/pull/691
#680https://github.com/voidzero-dev/void/issues/680
actions guidehttps://github.com/voidzero-dev/void/blob/main/docs/guide/pages-routing/actions-and-forms.md
cpojerhttps://github.com/cpojer
completedhttps://github.com/voidzero-dev/void/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#715https://github.com/voidzero-dev/void/pull/715
on Nov 4, 2026https://github.com/voidzero-dev/void/issues/714#event-35187175900
magurotunahttps://github.com/magurotuna
on Nov 5, 2026https://github.com/voidzero-dev/void/issues/714#event-35198367900
feat(pages): export isVoidActionError() to recognize action errors at…https://github.com/magurotuna/void/commit/be9b56895dbba0a3e067cc53d48d3aeabe4504d6
https://docs.github.com/articles/closing-issues-via-commit-messages
be9b568https://github.com/magurotuna/void/commit/be9b56895dbba0a3e067cc53d48d3aeabe4504d6
Sign up for freehttps://github.com/signup?return_to=https://github.com/voidzero-dev/void/issues/714
Sign in to commenthttps://github.com/login?return_to=https://github.com/voidzero-dev/void/issues/714
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.