@@ -21,17 +21,25 @@ const isJavaAvailable = commandExists('java').then(async (isAvailable) => {
2121 ]
2222 ) ;
2323
24- return result . exitCode === 0 ;
24+ // If Java is present, but it's working, we report it. Hoping that this will hunt done
25+ // some specific incompatibilities that we can better work around/detect.
26+ if ( result . exitCode !== 0 ) {
27+ console . log ( result . stdout ) ;
28+ console . log ( result . stderr ) ;
29+ throw new Error ( `JVM attach not available, exited with ${ result . exitCode } ` ) ;
30+ } else {
31+ return true ;
32+ }
2533} ) . catch ( ( e ) => {
26- // This is expected to happen occasionally, e.g. when using Java 8 (which doesn't support
27- // the VM attachment APIs we need).
28- console . log ( "Error checking for JVM targets" , e ) ;
34+ // This is expected to happen occasionally, e.g. when using Java 8 (which
35+ // doesn't support the VM attachment APIs we need).
36+ reportError ( e ) ;
2937 return false ;
3038} ) ;
3139
3240export class JvmInterceptor implements Interceptor {
3341 readonly id = 'attach-jvm' ;
34- readonly version = '1.0.0 ' ;
42+ readonly version = '1.0.1 ' ;
3543
3644 private interceptedProcesses : {
3745 [ pid : string ] : number // PID -> proxy port
@@ -113,11 +121,12 @@ export class JvmInterceptor implements Interceptor {
113121 proxyPort . toString ( ) ,
114122 this . config . https . certPath
115123 ] ,
116- { } ,
117- true // Inherit IO, so we can see output easily, if any
124+ { }
118125 ) ;
119126
120127 if ( interceptionResult . exitCode !== 0 ) {
128+ console . log ( interceptionResult . stdout ) ;
129+ console . log ( interceptionResult . stderr ) ;
121130 throw new Error ( `Failed to attach to JVM, exit code ${ interceptionResult . exitCode } ` ) ;
122131 } else {
123132 this . interceptedProcesses [ options . targetPid ] = proxyPort ;
0 commit comments