deal with java exceptions in auto_raise