package introspect;

import net.bytebuddy.instrumentation.method.bytecode.bind.annotation.*;

import java.lang.invoke.MethodHandle;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
import clojure.lang.IFn;

public class Interceptor {

	public static IFn callback;

  @RuntimeType
  public static Object intercept(@SuperCall Callable method,
                                 @This Object proxy,
                                 @AllArguments Object[] allArguments) throws Exception{

    Object returnValue = null;
    try {
      returnValue = method.call();
    } catch (Throwable throwable) {
			callback.invoke(proxy, allArguments, throwable);
      throwable.printStackTrace();
			throw throwable;
    }

		callback.invoke(proxy, allArguments, returnValue);
    return returnValue;
  }

	public static void setCallback(IFn fn) {
		callback = fn;
	}

}

@@ -664,25 +664,26 @@
  throws 
-Exception
+Throwable 
 %7B%0A%0A    O
@@ -789,19 +789,22 @@
 able) %7B%0A
-%09%09%09
+      
 callback
@@ -883,11 +883,14 @@
 ();%0A
-%09%09%09
+      
 thro
@@ -909,16 +909,47 @@
 %0A    %7D%0A%0A
+    System.out.println(proxy);%0A
 %09%09callba

Change signature