fix(server): include actual error details in DaemonRpcError messages

The catch-all handler was replacing real error messages with "Request
failed", and DaemonRpcError only showed the error string without
requestType or code context.
This commit is contained in:
Mohamed Boudra
2026-03-20 17:22:17 +07:00
parent 77fb74c188
commit 23aaecd99a
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -328,7 +328,10 @@ class DaemonRpcError extends Error {
readonly code?: string
constructor(params: { requestId: string; error: string; requestType?: string; code?: string }) {
super(params.error)
const parts = [params.error]
if (params.requestType) parts.push(`requestType=${params.requestType}`)
if (params.code) parts.push(`code=${params.code}`)
super(parts.join(' '))
this.name = 'DaemonRpcError'
this.requestId = params.requestId
this.requestType = params.requestType
+1 -1
View File
@@ -1723,7 +1723,7 @@ export class Session {
payload: {
requestId,
requestType: msg.type,
error: 'Request failed',
error: `Request failed: ${err.message}`,
code: 'handler_error',
},
})