Package javax.script

Examples of javax.script.ScriptException.initCause()


                msg = e.getMessage();
            }

            ScriptException scriptException =
                    new ScriptException(msg, e.sourceName(), line);
            scriptException.initCause(e);

            throw scriptException;
        } catch (IOException e) {
            throw new ScriptException(e);
        } finally {
View Full Code Here


            if (value != null) {
                if (value instanceof Wrapper) {
                    value = ((Wrapper) value).unwrap();
                }
                if (value instanceof Throwable) {
                    se.initCause((Throwable) value);
                }
            }
           
            // if the cause could not be set, overwrite the stack trace
            if (se.getCause() == null) {
View Full Code Here

        } catch (Throwable t) {

            final ScriptException se = new ScriptException(
                "Failure running script " + scriptName + ": " + t.getMessage());
            se.initCause(t);
            throw se;

        } finally {

            // if properties have been replaced, reset them
View Full Code Here

   
    if (t == null) {
      throw new ScriptException("Cannot compile script: " + parseLocation + " caused by " + msg);
    } else {
      ScriptException se = new ScriptException("Cannot compile script: " + parseLocation + " caused by " + msg);
      se.initCause(t);
      throw se;
    }
  }
 
  private static void throwScriptExecutionException(String parseLocation, Object[] params, Throwable e)
View Full Code Here

 
  private static void throwScriptExecutionException(String parseLocation, Object[] params, Throwable e)
      throws ScriptException {
   
    ScriptException se = new ScriptException("Cannot execute script: " + parseLocation + " for params " + Arrays.asList(params).toString());
    se.initCause(e);
    throw se;
  }
 
}
View Full Code Here

   
    if (t == null) {
      throw new ScriptException("Cannot compile script: " + parseLocation + " caused by " + msg);
    } else {
      ScriptException se = new ScriptException("Cannot compile script: " + parseLocation + " caused by " + msg);
      se.initCause(t);
      throw se;
    }
  }
 
  private static void throwScriptExecutionException(String parseLocation, Object[] params, Throwable e)
View Full Code Here

 
  private static void throwScriptExecutionException(String parseLocation, Object[] params, Throwable e)
      throws ScriptException {
   
    ScriptException se = new ScriptException("Cannot execute script: " + parseLocation + " for params " + Arrays.asList(params).toString());
    se.initCause(e);
    throw se;
  }
 
}
View Full Code Here

                        filename,
                        tb.tb_lineno);
            } else {
                se = new ScriptException(Py.formatException(type, value));
            }
            se.initCause(pye);
            return se;
        } catch (Exception ee) {
            se = new ScriptException(pye);
        }
        return se;
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.