Skip to content

Commit f51d4be

Browse files
committed
parse disconnect description
1 parent 56ec052 commit f51d4be

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

packages/cli-v3/src/entryPoints/managed/controller.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,32 @@ export class ManagedRunController {
486486
});
487487

488488
socket.on("disconnect", (reason, description) => {
489+
const parseDescription = ():
490+
| {
491+
description: string;
492+
context?: string;
493+
}
494+
| undefined => {
495+
if (!description) {
496+
return undefined;
497+
}
498+
499+
if (description instanceof Error) {
500+
return {
501+
description: description.toString(),
502+
};
503+
}
504+
505+
return {
506+
description: description.description,
507+
context: description.context ? String(description.context) : undefined,
508+
};
509+
};
510+
489511
this.sendDebugLog({
490512
runId: this.runFriendlyId,
491513
message: "Socket disconnected from supervisor",
492-
properties: { reason, description: description?.toString() },
514+
properties: { reason, ...parseDescription() },
493515
});
494516
});
495517

0 commit comments

Comments
 (0)