Examples of ScriptRuntimeException


Examples of webit.script.exceptions.ScriptRuntimeException

    public void write(final char[] chars, final int offset, final int length) {
        try {
            this.writer.write(chars, offset, length);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

    public void write(final char[] chars) {
        try {
            this.writer.write(chars);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

            string.getChars(offset, offset + length,
                    chars = this.buffers.getChars(length),
                    0);
            this.writer.write(chars, 0, length);
        } catch (IOException ex) {
            throw new ScriptRuntimeException(ex);
        }
    }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

        final int len;
        if (args != null && args.length > 0) {
            Object lenObject;
            if ((lenObject = args[0]) instanceof Number) {
                if ((len = ((Number) lenObject).intValue()) < 0) {
                    throw new ScriptRuntimeException(StringUtil.concat("must given a nonnegative number as array's length: ", len));
                }
            } else {
                throw new ScriptRuntimeException(StringUtil.concatObjectClass("must given a number as array's length, but get a: ", lenObject));
            }
        } else {
            len = 0;
        }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

            methodArgs = new Object[myArgsCount];
        }
        try {
            return constructor.newInstance(methodArgs);
        } catch (InstantiationException ex) {
            throw new ScriptRuntimeException("Can't create new instance: ".concat(ex.getLocalizedMessage()));
        } catch (IllegalAccessException ex) {
            throw new ScriptRuntimeException("Unaccessible method: ".concat(ex.getLocalizedMessage()));
        } catch (IllegalArgumentException ex) {
            throw new ScriptRuntimeException("Illegal arguments: ".concat(ex.getLocalizedMessage()));
        } catch (InvocationTargetException ex) {
            throw new ScriptRuntimeException("this method throws an exception", ex.getTargetException());
        }
    }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

                result = function.invoke(context, args);
                context.vars = bakVars;
                context.indexers = bakIndexers;
                return result;
            } catch (Exception e) {
                throw new ScriptRuntimeException(StatementUtil.castToScriptRuntimeException(e, function).setTemplate(template));
            }
        }
    }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

                obj = args[0];
                int copyLen;
                //Note: Warning 参数个数不一致
                System.arraycopy(args, 1, methodArgs = new Object[myArgsCount], 0, ((copyLen = args.length - 1) <= myArgsCount) ? copyLen : myArgsCount);
            } else {
                throw new ScriptRuntimeException("this method need one argument at least");
            }
        }
        try {
            Object result = method.invoke(obj, methodArgs);
            return noVoid ? result : Context.VOID;
        } catch (IllegalAccessException ex) {
            throw new ScriptRuntimeException("this method is inaccessible: ".concat(ex.getLocalizedMessage()));
        } catch (IllegalArgumentException ex) {
            throw new ScriptRuntimeException("illegal argument: ".concat(ex.getLocalizedMessage()));
        } catch (InvocationTargetException ex) {
            throw new ScriptRuntimeException("this method throws an exception", ex.getTargetException());
        }
    }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

                : list.toArray(new LoopInfo[list.size()]);
    }

    public static ScriptRuntimeException castToScriptRuntimeException(final Exception exception, final Statement statement) {
        if (exception instanceof ScriptRuntimeException) {
            ScriptRuntimeException scriptException = (ScriptRuntimeException) exception;
            scriptException.registStatement(statement);
            return scriptException;
        } else {
            return new ScriptRuntimeException(exception.toString(), exception, statement);
        }
    }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

    }

    private TemplateException completeException(final Exception exception) {
        return ((exception instanceof TemplateException)
                ? ((TemplateException) exception)
                : new ScriptRuntimeException(exception)).setTemplate(this);
    }
View Full Code Here

Examples of webit.script.exceptions.ScriptRuntimeException

    protected final Object handleNullPointer() {
        if (this.ignoreNullPointer) {
            return null;
        }
        throw new ScriptRuntimeException("Null pointer.");
    }
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.