Package play.exceptions

Examples of play.exceptions.PlayException


                                                        // 2,
                                                        // myerror500.html

    if (asBoolean(exp instanceof PlayException)) {// line 87,
                            // myerror500.html
      PlayException exception = (PlayException) exp;// line 88,
                              // myerror500.html
      Integer lineNumber = exception.getLineNumber();// line 89,
                              // myerror500.html
      String mode = play.Play.mode.name();// line 90, myerror500.html
      List<String> source = exception.isSourceAvailable() ? ((SourceAttachment) exception).getSource() : null;// line
                                                          // 91,
                                                          // myerror500.html
      int sourceSize = source == null ? -1 : source.size();// line 92,
                                  // myerror500.html
      p("    <div id=\"header\" class=\"block\">\n" + "        <h1>\n" + "            ");// line
                                                // 92,
                                                // myerror500.html
      p((exception.getErrorTitle()));// line 95, myerror500.html
      p(" \n" + "        </h1>\n" + "        ");// line 95,
                            // myerror500.html
      if (asBoolean(mode.equals("DEV"))) {// line 97, myerror500.html
        p("          <p>\n" + "              ");// line 97,
                            // myerror500.html
        p((exception.getErrorDescription()));// line 99, myerror500.html
        p("          </p>\n" + "        ");// line 99, myerror500.html
      }// line 101, myerror500.html
      if (asBoolean(mode.equals("PROD"))) {// line 102, myerror500.html
        p("          <p>\n"
            + "              ... Error details are not displayed when Play! is in PROD mode. Check server logs for detail.\n"
            + "          </p>\n" + "        ");// line 102,
                              // myerror500.html
      }// line 106, myerror500.html
      p("    </div>\n" + "    ");// line 106, myerror500.html
      if (asBoolean(exception.isSourceAvailable() && lineNumber != null && mode.equals("DEV"))) {// line
                                                    // 108,
                                                    // myerror500.html
        p("      <div id=\"source\" class=\"block\">\n" + "          <h2>In ");// line
                                            // 108,
                                            // myerror500.html
        p(exception.getSourceFile());// line 110, myerror500.html
        p(" (around line ");// line 110, myerror500.html
        p(lineNumber);// line 110, myerror500.html
        p(")</h2>\n" + "            \n" + "            ");// line 110,
                                  // myerror500.html
        int from = lineNumber - 5 >= 0 && lineNumber <= sourceSize ? lineNumber - 5 : 0;// line
                                                // 112,
                                                // myerror500.html
        int to = lineNumber + 5 < sourceSize ? lineNumber + 5 : sourceSize - 1;// line
                                            // 113,
                                            // myerror500.html

        for (int i = from; i < to; i++) {// line 115, myerror500.html
          String line = source.get(i);// line 116, myerror500.html
          p("                <div class=\"line ");// line 116,
                              // myerror500.html
          p(lineNumber.equals(i + 1) ? "error" : "");// line 117,
                                // myerror500.html
          p("\">\n" + "                    <span class=\"lineNumber\">");// line
                                          // 117,
                                          // myerror500.html
          p(i + 1);// line 118, myerror500.html
          p(":</span>\n" + "                    <pre>&nbsp;");// line
                                    // 118,
                                    // myerror500.html
          p(escape(line));// line 119, myerror500.html
          p("</pre>\n" + "                </div>\n" + "          ");// line
                                        // 119,
                                        // myerror500.html
        }// line 121, myerror500.html
        p("      </div>\n" + "    ");// line 121, myerror500.html
      }// line 123, myerror500.html

      String moreHtml = exception.getMoreHTML();// line 125,
                            // myerror500.html
      if (asBoolean(moreHtml)) {// line 126, myerror500.html
        p("        <div id=\"specific\" class=\"block\">\n" + "            ");// line
                                            // 126,
                                            // myerror500.html
        p(moreHtml);// line 128, myerror500.html
        p("        </div>\n" + "    ");// line 128, myerror500.html
      }// line 130, myerror500.html
      p("    <div id=\"more\" class=\"block\">\n" + "        This exception has been logged with id <strong>");// line
                                                            // 130,
                                                            // myerror500.html
      p(exception.getId());// line 132, myerror500.html
      p("</strong>\n" + "    </div>\n");// line 132, myerror500.html
    } else {// line 134, myerror500.html
      p("    <div id=\"header\" class=\"block\">\n" + "        <h1>");// line
                                      // 134,
                                      // myerror500.html
View Full Code Here


            StringWriter sw = new StringWriter();

            // Better format for Play exceptions
            if (e instanceof PlayException) {
                PlayException playException = (PlayException) e;
                PrintWriter errorOut = new PrintWriter(sw);
                errorOut.println("");
                errorOut.println("");
                errorOut.println("@" + playException.getId());
                errorOut.println(format(message, args));
                errorOut.println("");
                if (playException.isSourceAvailable()) {
                    errorOut.println(playException.getErrorTitle() + " (In " + playException.getSourceFile() + " around line " + playException.getLineNumber() + ")");
                } else {
                    errorOut.println(playException.getErrorTitle());
                }
                errorOut.println(playException.getErrorDescription().replaceAll("</?\\w+/?>", "").replace("\n", " "));
            } else {
                sw.append(format(message, args));
            }

            try {
View Full Code Here

            StringWriter sw = new StringWriter();

            // Better format for Play exceptions
            if (e instanceof PlayException) {
                PlayException playException = (PlayException) e;
                PrintWriter errorOut = new PrintWriter(sw);
                errorOut.println("");
                errorOut.println("");
                errorOut.println("@" + playException.getId());
                errorOut.println(format(message, args));
                errorOut.println("");
                if (playException.isSourceAvailable()) {
                    errorOut.println(playException.getErrorTitle() + " (In " + playException.getSourceFile() + " around line " + playException.getLineNumber() + ")");
                } else {
                    errorOut.println(playException.getErrorTitle());
                }
                errorOut.println(playException.getErrorDescription().replaceAll("</?\\w+/?>", "").replace("\n", " "));
            } else {
                sw.append(format(message, args));
            }

            try {
View Full Code Here

            StringWriter sw = new StringWriter();

            // Better format for Play exceptions
            if (e instanceof PlayException) {
                PlayException playException = (PlayException) e;
                PrintWriter errorOut = new PrintWriter(sw);
                errorOut.println("");
                errorOut.println("");
                errorOut.println("@" + playException.getId());
                errorOut.println(format(message, args));
                errorOut.println("");
                if (playException.isSourceAvailable()) {
                    errorOut.println(playException.getErrorTitle() + " (In " + playException.getSourceFile() + " around line " + playException.getLineNumber() + ")");
                } else {
                    errorOut.println(playException.getErrorTitle());
                }
                errorOut.println(playException.getErrorDescription().replaceAll("</?\\w+/?>", "").replace("\n", " "));
            } else {
                sw.append(format(message, args));
            }

            try {
View Full Code Here

TOP

Related Classes of play.exceptions.PlayException

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.