Examples of QuercusException


Examples of com.caucho.quercus.QuercusException

  {
    int mask = 1 << B_WARNING;
   
    if ((_errorMask & mask) != 0) {
      if (log.isLoggable(Level.FINER)) {
        QuercusException e = new QuercusException(msg);

        log.log(Level.FINER, e.toString(), e);
      }
    }

    return error(B_WARNING, location, "", msg + getFunctionLocation());
  }
View Full Code Here

Examples of com.caucho.quercus.QuercusException

   * A runtime strict warning.
   */
  public Value strict(String msg)
  {
    if (log.isLoggable(Level.FINER)) {
      QuercusException e = new QuercusException(msg);

      log.log(Level.FINER, e.toString(), e);
    }

    return error(B_STRICT, "", msg + getFunctionLocation());
  }
View Full Code Here

Examples of com.caucho.quercus.QuercusException

  public Value error(int code, Location location, String loc, String msg)
  {
    int mask = 1 << code;

    if (log.isLoggable(Level.FINEST)) {
      QuercusException e = new QuercusException(loc + msg);

      log.log(Level.FINEST, e.toString(), e);
    }
   
    if ((_errorMask & mask) != 0) {
      if (log.isLoggable(Level.FINE))
        log.fine(this + " " + loc + msg);
    }

    if (code >= 0 && code < _errorHandlers.length
        && _errorHandlers[code] != null) {
      Callback handler = _errorHandlers[code];

      try {
        _errorHandlers[code] = null;

        Value fileNameV = NullValue.NULL;

        if (location == null)
          location = getLocation();

        String fileName = location.getFileName();

        if (fileName != null)
          fileNameV = createString(fileName, null);

        Value lineV = NullValue.NULL;
        int line = location.getLineNumber();
        if (line > 0)
          lineV = LongValue.create(line);

        Value context = NullValue.NULL;

        handler.call(this, LongValue.create(mask), createStringOld(msg),
                     fileNameV, lineV, context);

        return NullValue.NULL;
      }
      catch (RuntimeException e) {
        throw e;
      }
      catch (Throwable e) {
        throw new RuntimeException(e);
      }
      finally {
        _errorHandlers[code] = handler;
      }
    }

    if ((_errorMask & mask) != 0) {
      try {
        String fullMsg = (getLocationPrefix(location, loc)
                          + getCodeName(mask) + msg);

        if (getIniBoolean("track_errors"))
          setGlobalValue("php_errormsg", createStringOld(fullMsg));
       
        if ("stderr".equals(getIniString("display_errors")))
          System.err.println(fullMsg);
        else if (getIniBoolean("display_errors"))
          getOut().println(fullMsg);

        if (getIniBoolean("log_errors"))
          log.info(fullMsg);
      }
      catch (IOException e) {
        log.log(Level.FINE, e.toString(), e);
      }
    }

    if ((mask & (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR)) != 0)
    {
View Full Code Here

Examples of com.caucho.quercus.QuercusException

          return true;
        }
      }
    } catch (NoSuchMethodException e) {
      throw new QuercusException(e);
    } catch (InvocationTargetException e) {
      throw new QuercusException(e);
    } catch (IllegalAccessException e) {
      throw new QuercusException(e);
    } catch (SQLException e) {
      getEnv().warning(L.l("unable to change user to '{0}'", user));

      return false;
    }
View Full Code Here

Examples of com.caucho.quercus.QuercusException

        byte[] bytes;
       
        try {
          bytes = s.getBytes(encoding);
        } catch (UnsupportedEncodingException e) {
          throw new QuercusException(e);
        }

        value = _env.createStringBuilder();
       
        value.append(bytes);
View Full Code Here

Examples of com.caucho.quercus.QuercusException

    catch (UnsupportedEncodingException e) {
      log.log(Level.FINE, e.getMessage(), e);
      env.warning(L.l(e.getMessage()));
    }
    catch (NoClassDefFoundError e) {
      throw new QuercusException(L.l("mime_decode requires javamail.jar"));
    }

    return BooleanValue.FALSE;
  }
View Full Code Here

Examples of com.caucho.quercus.QuercusException

  {
    try {
      return createRegexpImpl(regexpValue);
    }
    catch (IllegalRegexpException e) {
      throw new QuercusException(e);
    }
  }
View Full Code Here

Examples of com.caucho.quercus.QuercusException

  private static Regexp createRegexpImpl(StringValue regexpValue)
    throws IllegalRegexpException
  {
    if (regexpValue.length() < 2) {
      throw new QuercusException(L.l("Regexp pattern must have opening and closing delimiters"));
    }

    RegexpCacheItem cacheItem = _regexpCache.get(regexpValue);

    if (cacheItem == null) {
View Full Code Here

Examples of com.caucho.quercus.QuercusException

      }

      return ereg;
    }
    catch (IllegalRegexpException e) {
      throw new QuercusException(e);
    }
  }
View Full Code Here

Examples of com.caucho.quercus.QuercusException

      }

      return eregi;
    }
    catch (IllegalRegexpException e) {
      throw new QuercusException(e);
    }
  }
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.