Package javax.script

Examples of javax.script.ScriptException.initCause()


            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


            // prevent variables to be pushed back in case of errors
            isTopLevelCall = false;

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

        } finally {

            // if we are the top call (the Context is now null) we have to
View Full Code Here

            scriptContext.getWriter().write(
                (String) JavaEmbedUtils.invokeMethod(runtime, erb, "result",
                    new Object[] { binding }, String.class));
        } catch (Throwable t) {
          final ScriptException ex = new ScriptException("Failure running Ruby script:" + t);
          ex.initCause(t);
          throw ex;
        } finally {
          Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
        return null;
View Full Code Here

            parser.setProperty("http://cyberneko.org/html/properties/names/elems", "lower");
            parser.setProperty("http://cyberneko.org/html/properties/names/attrs", "lower");
            parser.parse(new InputSource(scriptStream));
        } catch(Exception e) {
            final ScriptException se = new ScriptException("Error parsing script " + scriptPath);
            se.initCause(e);
            throw se;
        }
        final Document template = parser.getDocument();

        // compute default rendering
View Full Code Here

            final DOMSource source = new DOMSource(template);
            t.transform(source, result);

        } catch (Exception e) {
            final ScriptException se = new ScriptException("Error in XSLT transform for " + scriptPath);
            se.initCause(e);
            throw se;

        } finally {
            xslTransform.close();
        }
View Full Code Here

      interp.exec(scriptString.toString());

    } catch (Throwable t) {
      final ScriptException ex = new ScriptException(
          "Failure running Python script:" + t);
      ex.initCause(t);
      throw ex;
    } finally {
      Thread.currentThread().setContextClassLoader(oldClassLoader);
    }
    return null;
View Full Code Here

      xpl.getEnv().setSling(helper);
      xpl.eval();
    } catch (Throwable t) {
      log.error("Failure running XProc script.", t);
      final ScriptException se = new ScriptException("Failure running XProc script " + scriptName);
      se.initCause(t);
      throw se;
    }
   
    return 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 {
           
            Context.exit();
View Full Code Here

                msg = e.getMessage();
            }

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

            throw scriptException;
        } finally {
            Context.exit();
        }
View Full Code Here

                msg = e.getMessage();
            }

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

            throw scriptException;
        } finally {
            Context.exit();
        }
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.