Examples of StackTrace


Examples of org.rascalmpl.interpreter.StackTrace

 
  public static Throw javaException(Throwable targetException, AbstractAST ast, StackTrace rascalTrace) throws ImplementationError {
    try {
      String clazz = targetException.getClass().getSimpleName();
      String msg = targetException.getMessage();
      StackTrace trace = buildTrace(targetException, rascalTrace);
      Throwable cause = targetException.getCause();

      if (cause != null && cause != targetException) {
        Throw throwCause = cause instanceof Throw ? (Throw) cause : javaException(cause, ast, rascalTrace);
        return javaException(clazz, msg != null ? msg : "", throwCause.getException(), ast, trace);
View Full Code Here

Examples of org.rascalmpl.interpreter.StackTrace

    return VF.sourceLocation(uri, offset, length, beginLine, endLine, beginCol, endCol);
    }

  private static StackTrace buildTrace(Throwable targetException, StackTrace rascalTrace) throws IOException {
    StackTraceElement[] stackTrace = targetException.getStackTrace();
    StackTrace newTrace = new StackTrace();
    for (StackTraceElement elem : stackTrace) {
      if (elem.getMethodName().equals("invoke")) {
        break;
      }
      newTrace.add(robustSourceLocation(elem.getFileName(), 0, 0, elem.getLineNumber(), elem.getLineNumber(), 0, 0), elem.getClassName() + "." + elem.getMethodName());
    }
    newTrace.addAll(rascalTrace);
    return newTrace.freeze();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.