This repository was archived by the owner on Jul 30, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
plugins/plugin-kubectl/src/lib/util Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -39,12 +39,8 @@ setMedia(Media.Headless)
39
39
let exitCode = 0
40
40
41
41
// electron pops up a window by default, for uncaught exceptions
42
- process . on ( 'uncaughtException' , async ( err : Error ) => {
43
- debug ( 'uncaughtException' )
44
- debug ( err )
45
- const colors = await import ( 'colors/safe' )
46
- console . error ( colors . red ( err . toString ( ) ) )
47
- process . exit ( 1 )
42
+ process . on ( 'uncaughtException' , ( err : Error ) => {
43
+ console . error ( 'Uncaught Exception' , err )
48
44
} )
49
45
50
46
process . on ( 'exit' , code => {
Original file line number Diff line number Diff line change @@ -94,8 +94,18 @@ export async function openStream<T extends object>(
94
94
} )
95
95
96
96
stream . on ( 'error' , err => {
97
- debug ( 'stream suddenly died' , err )
98
- throw new Error ( err )
97
+ //
98
+ // It's highly likely to be ok if the stream went away. This is
99
+ // usually a sign that we are in the Kui proxy, and the Kui browser
100
+ // client simply went away.
101
+ //
102
+ // !!DANGER!!: do not throw an exception here, as it will currently
103
+ // percolate all the way up and result in a Kui proxy
104
+ // failure due to an uncaughtException.
105
+ //
106
+ if ( err . code !== 'ERR_STREAM_DESTROYED' ) {
107
+ console . error ( 'stream suddenly died' , err )
108
+ }
99
109
} )
100
110
101
111
JSONStream ( stream , await onData , mgmt . onExit )
You can’t perform that action at this time.
0 commit comments