Package anvil

Examples of anvil.ErrorEvent


    if (exception instanceof ForgingException) {
      ErrorListener listener = ((ForgingException)exception).getErrorListener();
      Enumeration e = listener.getEvents();
      int count = 0;
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        String url;
        if (loc != null) {
          url = loc.getURL().toString();
          out.print(url);
          if (loc.getLine()>0) {
            out.print(" [");
            out.print(loc.getLine());
            if (loc.getColumn()>0) {
              out.print(":");
              out.print(loc.getColumn());
            }
            out.print("]");
          }
          out.println();

        } else {
          out.println("Unknown location");
        }
        String msg = evt.getMessage();
        if (msg != null) {
          out.print(Conversions.encodeEntities(msg));
        }
        count++;
        out.println("<br/>");
View Full Code Here


      Enumeration e = listener.getEvents();
      int count = 0;
      URL last = null;
      URL url;
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        if (loc != null) {
          url = loc.getURL();
          if (url != null) {
            if (last == null || !last.equals(url)) {
              last = url;
              out.print(url);
              out.println(':');
            }
          }
          out.print("  ");
          if (loc.getLine() > 0) {
            out.print('[');
            out.print(loc.getLine());
            if (loc.getColumn() > 0) {
              out.print(':');
              out.print(loc.getColumn());
            }
            out.print("] ");
          }
        }
        out.println(evt.getMessage());
        count++;
      }
    } else if (exception instanceof ScriptException) {
      out.println("Uncaught exception: ");
      out.println(((ScriptException)exception).getData().toString());
View Full Code Here

    if (_listener != null) {
      buffer.append("\n");
      Enumeration e = _listener.getEvents();
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        URL url;
        int line, column;
        if (loc != null) {
          url = loc.getURL();
          line = loc.getLine();
          column = loc.getColumn();
        } else {
          url = null;
          line = 0;
          column = 0;
        }
        url = (loc != null) ? loc.getURL() : null;
        if (url != null) {
          buffer.append(url.toString());
        } else {
          buffer.append("unknown");
        }
        if (line != 0) {
          buffer.append(" [");
          buffer.append(line);
          if (column != 0) {
            buffer.append(":");
            buffer.append(column);
          }
          buffer.append(']');
        }
        buffer.append("\n  ");
        buffer.append(evt.getMessage());
        buffer.append('\n');
        Throwable throwable = evt.getThrowable();
        if (throwable != null) {
          buffer.append("      ");
          buffer.append(throwable.toString());
          buffer.append('\n');
        }
View Full Code Here

  {
    if (_listener != null) {
      Array errors = new Array(_listener.errors());
      Enumeration e = _listener.getEvents();
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        URL url;
        int line;
        int column;
        if (loc != null) {
          url = loc.getURL();
          line = loc.getLine();
          column = loc.getColumn();
        } else {
          url = null;
          line = 0;
          column = 0;
        }
        url = (loc != null) ? loc.getURL() : null;
        Array error = new Array(7);
        error.append(STR_URL, (url != null) ? new anvil.core.net.AnyURL(url) : Any.NULL);
        error.append(STR_LINE, Any.create(line));
        error.append(STR_COLUMN, Any.create(column));
        error.append(STR_MESSAGE, Any.create(evt.getMessage()));
        Throwable throwable = evt.getThrowable();
        if (throwable != null) {
          error.append(STR_EXCEPTION, Any.create(throwable.toString()));
        } else {
          error.append(STR_EXCEPTION, Any.NULL);
        }
View Full Code Here

      Enumeration e = listener.getEvents();
      int count = 0;
      URL last = null;
      URL url;
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
        _errors++;
      if (loc != null) {
          url = loc.getURL();
          if (url != null) {
            if (last == null || !last.equals(url)) {
              last = url;
              out.print(url);
              out.println(':');
            }
          }
          out.print("  ");
          if (loc.getLine() > 0) {
            out.print('[');
            out.print(loc.getLine());
            if (loc.getColumn() > 0) {
              out.print(':');
              out.print(loc.getColumn());
            }
            out.print("] ");
          }
        }
        out.println(evt.getMessage());
        count++;
      }
    } else {
      out.println(throwable.toString());
      throwable.printStackTrace();
View Full Code Here

   
    if (exception instanceof ForgingException) {
      ErrorListener listener = ((ForgingException)exception).getErrorListener();
      Enumeration e = listener.getEvents();
      while(e.hasMoreElements()) {
        ErrorEvent evt = (ErrorEvent)e.nextElement();
        Location loc = evt.getLocation();
       
        out.print(
          "        <tr bgcolor=\"#f0f0ff\">\n" +
          "          <td><code><strong>");
         
        if (loc != null) {
          out.print("<a href=\"");
          String url = (loc.getURL() != null) ? loc.getURL().toString() : "";
          out.print(url);
          out.print("\">");
          out.print(url);
          out.print("</a>");
        } else {
          out.println("Unknown location");
        }

        out.print(
          "<strong></code></td>" +
          "          <td><code><strong>");

        if (loc != null) {
          int line = loc.getLine();
          if (line > 0) {
            out.print(line);
          } else {
            out.print("&nbsp;");
          }
        } else {
          out.print("&nbsp;");
        }

        out.print(
          "</strong></code></td>\n" +
          "          <td><code><strong>");

        if (loc != null) {
          int column = loc.getColumn();
          if (column > 0) {
            out.print(column);
          } else {
            out.print("&nbsp;");
          }
        }else {
          out.print("&nbsp;");
        }
         
        out.print(
          "</strong></code></td>\n" +
          "        </tr>      \n" +
          "        <tr bgcolor=\"#f0f0ff\">\n" +
          "          <td colspan=\"3\">\n" +
          "            <font face=\"verdana,lucida,arial,helvetica\" size=2>");

        String msg = evt.getMessage();
        if (msg != null) {
          out.print(Conversions.encodeEntities(msg));
        } else {
          out.println("&nbsp;");
        }
View Full Code Here

TOP

Related Classes of anvil.ErrorEvent

Copyright © 2018 www.massapicom. 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.