Skip to content

fix(dashboard): show the message inside a Cloudflare tunnel error object - #15365

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
HouMinXi:fix/tunnel-error-object
Oct 6, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.52from
HouMinXi:fix/tunnel-error-object

Conversation

@HouMinXi

@HouMinXi HouMinXi commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Starting a Cloudflare quick tunnel can be rejected with a structured body whose error field is an object. The endpoint page passed that object straight into new Error, so the notice rendered as [object Object] instead of the message inside it.
  • The page now reads the message out of the body through the existing extractApiErrorMessage helper. A string error still shows as is, and a body with no message falls back to the previous text.

Related Issues

Validation

  • Change type: other (dashboard error display)
  • Focused tests: vitest on cloudflared-object-error.test.tsx (1 pass) and node --import tsx/esm --test on cloudflared-object-error.node.test.ts (3 pass)
  • eslint on the changed files, with the repo suppression file
  • Reconciled with release/v3.8.52 @ 23a1148486
  • New tests cover the change
  • Defect injection: restoring new Error(data?.error || ...) makes both suites fail again, and the change was restored

Tests Added Or Updated

  • src/app/(dashboard)/dashboard/endpoint/__tests__/cloudflared-object-error.test.tsx (added)
  • src/app/(dashboard)/dashboard/endpoint/__tests__/cloudflared-object-error.node.test.ts (added)

Coverage Notes

  • The component test mounts the page, triggers the tunnel action against an object error body, and asserts the notice shows the message and not [object Object].

Reviewer Notes

  • The 403 LOCAL_ONLY is left as is. The tunnel route spawns a process, so a request that is neither loopback nor private is refused on purpose. This change only fixes what the operator sees.

Starting a quick tunnel can be rejected with a structured body whose
error field is an object. The endpoint page passed that object straight
into new Error, so the notice rendered as [object Object]. The page now
reads the message out of the body, and a string error still shows as is.

The 403 LOCAL_ONLY itself is intended. The tunnel route spawns a process,
so a request that is neither loopback nor private is refused.

Signed-off-by: Minxi Hou <houminxi@gmail.com>
@HouMinXi
HouMinXi requested a review from diegosouzapw as a code owner October 2, 2026 17:15
@diegosouzapw
diegosouzapw merged commit a5a056e into diegosouzapw:release/v3.8.52 Oct 6, 2026
42 of 51 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.

fix: can't create cloudflare quick tunnel (403 LOCAL_ONLY shown as [object Object])

2 participants