File tree Expand file tree Collapse file tree
extended/src/main/java/io/kubernetes/client/extended/kubectl Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121import java .io .IOException ;
2222import java .io .InputStream ;
2323import java .io .OutputStream ;
24+ import java .util .Optional ;
2425import java .util .function .Consumer ;
2526
2627public class KubectlExec extends Kubectl .ResourceAndContainerBuilder <V1Pod , KubectlExec >
@@ -82,7 +83,7 @@ public void run() {
8283 try {
8384 Streams .copy (in , out );
8485 } catch (IOException ex ) {
85- onUnhandledError .accept (ex );
86+ Optional . ofNullable ( onUnhandledError ). orElse ( Throwable :: printStackTrace ) .accept (ex );
8687 }
8788 }
8889 });
Original file line number Diff line number Diff line change 2525import java .net .Socket ;
2626import java .util .ArrayList ;
2727import java .util .List ;
28+ import java .util .Optional ;
2829import java .util .function .Consumer ;
2930
3031public class KubectlPortForward
@@ -111,7 +112,7 @@ public void run() {
111112 t1 .join ();
112113 t2 .join ();
113114 } catch (InterruptedException | IOException ex ) {
114- onUnhandledError .accept (ex );
115+ Optional . ofNullable ( onUnhandledError ). orElse ( Throwable :: printStackTrace ) .accept (ex );
115116 }
116117 }
117118 }
You can’t perform that action at this time.
0 commit comments