@TruffleBoundary static void exceptionEventForClientInstrument(EventBinding<?> b,String eventName,Throwable t){
  assert !b.isLanguageBinding();
  if (t instanceof ThreadDeath) {
    throw (ThreadDeath)t;
  }
  InstrumentClientInstrumenter instrumenter=(InstrumentClientInstrumenter)b.getInstrumenter();
  Class<?> instrumentClass=instrumenter.getInstrumentClass();
  String message=String.format("Event %s failed for instrument class %s and listener/factory %s.",eventName,instrumentClass.getName(),b.getElement());
  Exception exception=new Exception(message,t);
  PrintStream stream=new PrintStream(instrumenter.getEnv().err());
  exception.printStackTrace(stream);
}

@ TruffleBoundary static void exceptionEventForClientInstrument ( EventBinding < ? > b , String eventName , Throwable t ) { assert ! b . isLanguageBinding ( ) ; if ( t instanceof ThreadDeath ) { throw ( ThreadDeath ) t ; } InstrumentClientInstrumenter instrumenter = ( InstrumentClientInstrumenter ) b . getInstrumenter ( ) ; Class < ? > instrumentClass = instrumenter . getInstrumentClass ( ) ; String message = String . format ( "Event %s failed for instrument class %s and listener/factory %s." , eventName , instrumentClass . getName ( ) , b . getElement ( ) ) ; Exception exception = new Exception ( message , t ) ; PrintStream stream = new PrintStream ( instrumenter . getEnv ( ) . err ( ) ) ; exception . printStackTrace ( stream ) ; }
handles exceptions from non - language instrumentation code that must not be allowed to alter guest language execution semantics . normal response is to log and continue .
