File tree Expand file tree Collapse file tree
packages/cli-v3/src/entryPoints/managed Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments