Here is a simple example. First we create a bunch of labels for the variaous points in the code we need to refer to. Then we set up a try-catch block around the method execution. Then we call the code in the "try" block, and if an exception is thrown in the try block, execution will jump to the lCatchBlockStart label with the exception on the stack. The example catch block calls e.printStackTrace().
I used local variable number 1 in this example because it happened to be available. You might have to choose some other variable - of course you don't have to store the exception in a variable, but it is quite common to do so.
Unless you use the COMPUTE_FRAMES flag when constructing your ClassWriter you will have to insert visitFrame() calls as well.
Label lTryBlockStart = new Label();
Label lTryBlockEnd = new Label();
Label lCatchBlockStart = new Label();
Label lCatchBlockEnd = new Label();
// set up try-catch block for RuntimeException
mv.visitTryCatchBlock(lTryBlockStart, lTryBlockEnd, lCatchBlockStart, "java/lang/RuntimeException");
mv.visitLabel(lTryBlockStart);
// code to call the method goes here
mv.visitLabel(lTryBlockEnd);
mv.visitJumpInsn(GOTO, lCatchBlockEnd); // when here, no exception was thrown, so skip exception handler
// exception handler starts here, with RuntimeException stored on the stack
mv.visitLabel(lCatchBlockStart);
mv.visitVarInsn(ASTORE, 1); // store the RuntimeException in local variable 1
// here we could for example do e.printStackTrace()
mv.visitVarInsn(ALOAD, 1); // load it
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/RuntimeException", "printStackTrace", "()V");
// exception handler ends here:
mv.visitLabel(lCatchBlockEnd);