diff --git a/packages/@best/agent-hub/src/hub.ts b/packages/@best/agent-hub/src/hub.ts index ca90e7cd..27be7643 100644 --- a/packages/@best/agent-hub/src/hub.ts +++ b/packages/@best/agent-hub/src/hub.ts @@ -232,7 +232,7 @@ export class Hub extends EventEmitter { await remoteAgent.runBenchmarks(remoteClient); } catch (err) { console.log(`[HUB] Error running benchmark for remote client ${remoteClient.getId()}`); - remoteClient.disconnectClient(`Error running benchmark ${err}`); // make sure we disconnect the agent + remoteClient.disconnectClient(`Error running benchmark: ${(err as Error).message}`); // make sure we disconnect the agent } finally { this.activeClients.delete(remoteClient); queueMicrotask(() => this.runQueuedBenchmarks()); diff --git a/packages/@best/agent/src/agent.ts b/packages/@best/agent/src/agent.ts index 9bd02247..9bc0f76f 100644 --- a/packages/@best/agent/src/agent.ts +++ b/packages/@best/agent/src/agent.ts @@ -121,7 +121,7 @@ export class Agent extends EventEmitter { } catch (err) { console.log(`[AGENT] Error running benchmark for remote client ${remoteClient.getId()}`); console.log(err); - remoteClient.disconnectClient(`Error running benchmark ${err}`); // make sure we disconnect the agent + remoteClient.disconnectClient(`Error running benchmark: ${(err as Error).message}`); // make sure we disconnect the agent } finally { this.state = AgentState.IDLE; this.interruption = undefined; diff --git a/packages/@best/agent/src/remote-client.ts b/packages/@best/agent/src/remote-client.ts index a378bfd8..be3f1def 100644 --- a/packages/@best/agent/src/remote-client.ts +++ b/packages/@best/agent/src/remote-client.ts @@ -120,7 +120,7 @@ export default class RemoteClient extends EventEmitter implements RunnerStream { // Notify upload updates this.emit(BEST_RPC.REMOTE_CLIENT_UPLOAD_COMPLETED); } catch (err) { - this.disconnectClient(err as any); + this.disconnectClient((err as Error).message); this._requestJobError(err); } finally { this.state = RemoteClientState.IDLE; diff --git a/packages/@best/runner-remote/src/runner-remote.ts b/packages/@best/runner-remote/src/runner-remote.ts index 6a15ab7d..f685dca7 100644 --- a/packages/@best/runner-remote/src/runner-remote.ts +++ b/packages/@best/runner-remote/src/runner-remote.ts @@ -146,7 +146,7 @@ export class RunnerRemote { const uploader = await this._getUploaderInstance(); uploader.upload(tarBundle); } catch (err) { - return this._triggerBenchmarkError(err); + return this._triggerBenchmarkError((err as Error).message); } }); }