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:
@@ -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
|
||||
|
||||
@@ -1723,7 +1723,7 @@ export class Session {
|
||||
payload: {
|
||||
requestId,
|
||||
requestType: msg.type,
|
||||
error: 'Request failed',
|
||||
error: `Request failed: ${err.message}`,
|
||||
code: 'handler_error',
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user