mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-24 13:22:23 +02:00
Fix rejection
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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() }
|
||||
|
||||
Reference in New Issue
Block a user