Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Errors whose cause is a string defect show only "An error occurred."
Steps to reproduce
- Connect T3 Code to a server that answers
projectClone.startwith a defect. Any server will do; a remote control plane that doesn't implement the method returns:{"_tag":"Exit","requestId":"…","exit":{"_tag":"Failure","cause":[{"_tag":"Die","defect":"RPC contract is registered but unavailable in the control plane: projectClone.start"}]}} - In a project on another machine, open Add to another machine, choose that server as the target, and click Clone to ….
Expected: the dialog shows the defect text, or at least something that points at it, such as "projectClone.start is unavailable on this server".
Actual: the dialog shows only "An error occurred.", and nothing in the UI says which call failed or why.
Cause
squashAtomCommandFailure returns Cause.squash(cause). For a Die cause whose defect is a string, that is the string itself, not an Error. Every caller then formats it like this:
apps/web/src/lib/addProjectToMachine.tsfailureMessage(main, ba70b56):const error = squashAtomCommandFailure(result); return thrownErrorMessage(error, m) ?? m(msg("An error occurred."));
packages/client-runtime/src/errors/translatable.tsthrownErrorMessage:if (!(error instanceof Error)) return null;
So any non-Error value (a string defect, or a plain object) falls through to the generic message. The same instanceof Error ? … : "An error occurred." pattern appears in about 100 places in apps/ and packages/: BranchToolbar, ChatView.logic, CommandPalette, ProjectCloneToastCoordinator, useProjectCloneBanner and others.
Environment
- T3 Code desktop, web client at
pingdotgg/t3codemainba70b56b14(2026-11-23). - Target server: a t3code-rust embedded control plane (Cloudflare Durable Object build). Any server that returns a string defect reproduces it.
Notes
The server's reply above was captured from a local run of that control plane. The client behaviour is traced from the code paths above; I haven't stepped through it in a debugger.
Expected behavior
Have thrownErrorMessage (or a shared helper the call sites use) fall back to readable text for non-Error failures:
if (typeof error === "string" && error.trim() !== "") return error;
if (error && typeof error === "object" && typeof (error as { message?: unknown }).message === "string")
return (error as { message: string }).message;Keep "An error occurred." for values with no text at all. Optionally, log the squashed cause to the console whenever the generic message is shown, so the real reason is at least discoverable.
Actual behavior
When an RPC fails with a defect ({"_tag":"Die","defect":"<string>"}), the web client discards the defect text and shows the generic "An error occurred.". The server's explanation never reaches the user. This happens in "Add to another machine" and in most other places that report a command failure.
Impact
Minor bug or occasional failure
Version or commit
main @ ba70b56
Environment
macOS 27.0.1 (26A434)
Logs or stack traces
Screenshots, recordings, or supporting files
Workaround
No response
Activity
test(client-runtime): string defects keep their text in thrownErrorMe…