RuntimeException toJDIException() { switch (errorCode) { case JDWP.Error.INVALID_OBJECT: return new ObjectCollectedException(); case JDWP.Error.INVALID_MODULE: return new InvalidModuleException(); case JDWP.Error.VM_DEAD: return new VMDisconnectedException(); case JDWP.Error.OUT_OF_MEMORY: return new VMOutOfMemoryException(); case JDWP.Error.CLASS_NOT_PREPARED: return new ClassNotPreparedException(); case JDWP.Error.INVALID_FRAMEID: case JDWP.Error.NOT_CURRENT_FRAME: return new InvalidStackFrameException(); case JDWP.Error.NOT_IMPLEMENTED: return new UnsupportedOperationException(); case JDWP.Error.INVALID_INDEX: case JDWP.Error.INVALID_LENGTH: return new IndexOutOfBoundsException(); case JDWP.Error.TYPE_MISMATCH: return new InconsistentDebugInfoException(); case JDWP.Error.INVALID_THREAD: return new IllegalThreadStateException(); default: return new InternalException("Unexpected JDWP Error: " + errorCode, errorCode); } }
private EvaluateException processException(Exception e) { if(e instanceof InconsistentDebugInfoException) { return new EvaluateException(DebuggerBundle.message("error.inconsistent.debug.info"), null); } else if(e instanceof InvalidStackFrameException) { return new EvaluateException(DebuggerBundle.message("error.invalid.stackframe"), null); } else { return EvaluateExceptionUtil.DEBUG_INFO_UNAVAILABLE; } }