You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
walletError cause option appends the cause message to message #269
walletError({ code, message, cause }) in src/shared/errors.ts keeps message as given, so a site can attach the underlying error without changing the text that users, tests, and callers matching on error.message see.
Current Behavior
incur's BaseError sets message to ${shortMessage}\n\nDetails: ${cause.message} whenever cause is an Error, so passing cause changes the reported message. A spawn failure typed with cause: error reported Failed to run sqlite3 for the lock at <path>: spawn sqlite3 EACCES, then a blank line and Details: spawn sqlite3 EACCES, repeating the cause and breaking exact-message matches.
Possible Solution
Say on walletError that cause appends Details: <cause message> to message, with the given text kept on shortMessage, or let callers attach a cause without changing message.
Minimal Reproducible Example
walletError({ code: "E_RUNTIME", message: "failed", cause: new Error("boom") }).message is "failed\n\nDetails: boom".
Context
Hit while replacing bare Error rejections in src/payment/session-lock.ts with typed errors that keep their message text.
Logged by Brendan Ryan in tempoxyz/wallet-cli at 23c6345. Filed by Frog.
I'd like to pick this up. My preference is to change walletError in src/shared/errors.ts so passing cause keeps message as given, with a test that walletError({ code: "E_RUNTIME", message: "failed", cause: new Error("boom") }).message is "failed" and the cause is still attached. Does that work for you, or would you rather keep incur's BaseError behavior and just document that cause appends Details: <cause message>?
Activity
sharmis-tp commentedon Oct 19, 2026
I'd like to pick this up. My preference is to change
walletErrorinsrc/shared/errors.tsso passingcausekeepsmessageas given, with a test thatwalletError({ code: "E_RUNTIME", message: "failed", cause: new Error("boom") }).messageis"failed"and the cause is still attached. Does that work for you, or would you rather keep incur'sBaseErrorbehavior and just document thatcauseappendsDetails: <cause message>?