Fix rejection

This commit is contained in:
Andrey Sobolev
2025-09-29 22:25:38 +07:00
parent 6754bc7927
commit aeffd44939
3 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -164,7 +164,8 @@ export class BackRPCClient<ClientT extends string = ClientId> {
case backrpcOperations.responseError: {
const req = this.requests.get(reqId)
try {
req?.reject(JSON.parse(payload.toString()))
const { message, stack } = JSON.parse(payload.toString())
req?.reject(new Error(message + '\n' + stack))
} catch (err: any) {
console.error(err)
}
+2 -1
View File
@@ -272,7 +272,8 @@ export class BackRPCServer<ClientT extends string = ClientId> {
const reqID = reqId.toString()
const req = this.backRequests.get(reqID)
try {
req?.reject(JSON.parse(payload.toString()))
const { message, stack } = JSON.parse(payload.toString())
req?.reject(new Error(message + '\n' + stack))
} catch (err: any) {
console.error(err)
}
+1
View File
@@ -309,6 +309,7 @@ export class NetworkImpl implements Network, NetworkWithClients {
kind: ContainerKind,
options: GetOptions
): Promise<[ContainerUuid, ContainerEndpointRef]> {
console.log('Requesting container', clientUuid, kind, options)
let client = this._clients.get(clientUuid)
if (client === undefined) {
client = { lastSeen: this.tickManager.now(), containers: new Set(), agents: new Set() }