Examples of ScriptingException


Examples of com.liferay.portal.kernel.scripting.ScriptingException

        }
// CHECKSTYLE.OFF: IllegalCatch
        catch (final Exception e) {
// CHECKSTYLE.ON: IllegalCatch
            LOG.error("Error executing clojure script", e);
            throw new ScriptingException("Error executing clojure script", e);
        }
    }
View Full Code Here

Examples of helma.scripting.ScriptingException

                write("<h2>Error in application " + app.getName() + "</h2><p>");
                encode(getErrorMessage(throwable));
                writeln("</p>");
                if (app.debug()) {
                    if (throwable instanceof ScriptingException) {
                        ScriptingException scriptx = (ScriptingException) throwable;
                        writeln("<h4>Script Stack</h4>");
                        writeln("<pre>" + scriptx.getScriptStackTrace() + "</pre>");
                        writeln("<h4>Java Stack</h4>");
                        writeln("<pre>" + scriptx.getJavaStackTrace() + "</pre>");
                    } else {
                        writeln("<h4>Java Stack</h4>");
                        writeln("<pre>");
                        throwable.printStackTrace(new PrintWriter(this));
                        writeln("</pre>");
View Full Code Here

Examples of nexj.core.scripting.ScriptingException

         machine.returnValue(new InstanceAssociationCollection(this, arg.toString()), nArgCount);

         return false;
      }

      throw new ScriptingException(
         (nArgCount < 1) ? "err.scripting.maxArgCount" : "err.scripting.maxArgCount",
         new Object[]{"#<association-collection>", Primitive.createInteger(1),
         Primitive.createInteger(nArgCount)});
   }
View Full Code Here

Examples of nexj.core.scripting.ScriptingException

                  machine.returnValue(value, nArgCount);
               }
               else
               {
                  throw new ScriptingException("err.scripting.maxArgCount",
                     new Object[]{toString(),
                        Primitive.ONE_INTEGER,
                        Primitive.createInteger(nArgCount - 1)});
               }

               return false;
            }
            else
            {
               if (member.isStatic())
               {
                  machine.setArg(0, nArgCount, m_metaclass);
               }
               else
               {
                  machine.setArg(0, nArgCount, this);
               }

               if (m_metaclass.getLogger().isDebugEnabled())
               {
                  ((Event)member).dump(nArgCount, machine);
               }

               return ((Event)member).getFunction().invoke(nArgCount, machine);
            }
         }
      }
      else
      {
         throw new ScriptingException("err.scripting.minArgCount",
            new Object[]{m_metaclass.getName(),
               Primitive.ONE_INTEGER,
               Primitive.createInteger(nArgCount)});
      }

      throw new ScriptingException("err.scripting.funCall");
   }
View Full Code Here

Examples of nexj.core.scripting.ScriptingException

                  {
                     machine.returnValue(findValue(sName), nArgCount);
                  }
                  else
                  {
                     throw new ScriptingException("err.scripting.tobjAttribute", new Object[]{sName});
                  }
               }
               else
               {
                  machine.returnValue(findValue(sName), nArgCount);
               }
            }
            else if (nArgCount == 2)
            {
               Object value = machine.getArg(1, nArgCount);

               if (sName.length() > 0 && sName.charAt(0) == ':')
               {
                  if (sym == Symbol._EVENT)
                  {
                     if (value != null && !(value instanceof String))
                     {
                        throw new TypeMismatchException(Symbol._EVENT);
                     }
                    
                     setEventName((String)value);
                  }
                  else if (sym == Symbol._CLASS)
                  {
                     if (value != null && !(value instanceof String))
                     {
                        throw new TypeMismatchException(Symbol._CLASS);
                     }
                    
                     setClassName((String)value);
                  }
                  else if (sym == Symbol._OID)
                  {
                     if (value != null && !(value instanceof OID))
                     {
                        throw new TypeMismatchException(Symbol._OID);
                     }
                    
                     setOID((OID)value);
                  }
                  else if (sym == Symbol._VERSION)
                  {
                     if (!(value instanceof Number))
                     {
                        throw new TypeMismatchException(Symbol._VERSION);
                     }
                    
                     setVersion(((Number)value).shortValue());
                  }
                  else if (sym == Symbol._CONTAINS)
                  {
                     if (value instanceof Symbol)
                     {
                        value = Boolean.valueOf(hasValue(value.toString()));
                     }
                     else if (value instanceof String)
                     {
                        value = Boolean.valueOf(hasValue((String)value));
                     }
                     else
                     {
                        throw new TypeMismatchException(Symbol._CONTAINS);
                     }
                  }
                  else if (sym == Symbol._GET)
                  {
                     if (value instanceof Symbol)
                     {
                        value = getValue(value.toString());
                     }
                     else if (value instanceof String)
                     {
                        value = getValue((String)value);
                     }
                     else
                     {
                        throw new TypeMismatchException(Symbol._GET);
                     }
                  }
                  else if (sym == Symbol._REMOVE)
                  {
                     if (value instanceof Symbol)
                     {
                        value = Boolean.valueOf(removeValue(value.toString()));
                     }
                     else if (value instanceof String)
                     {
                        value = Boolean.valueOf(removeValue((String)value));
                     }
                     else
                     {
                        throw new TypeMismatchException(Symbol._REMOVE);
                     }
                  }
                  else if (sym == Symbol._PRE)
                  {
                     setValue(sName, value);
                  }
                  else
                  {
                     throw new ScriptingException("err.scripting.tobjAttribute", new Object[]{sName});
                  }
               }
               else
               {
                  setValue(sName, value);
               }

               machine.returnValue(value, nArgCount);
            }
            else
            {
               throw new ScriptingException("err.scripting.maxArgCount",
                  new Object[]{sym.toString(),
                     Primitive.ONE_INTEGER,
                     Primitive.createInteger(nArgCount - 1)});
            }

            return false;
         }
         else
         {
            throw new ScriptingException("err.scripting.funCall");
         }
      }
      else
      {
         throw new ScriptingException("err.scripting.minArgCount",
            new Object[]{"TransferObject",
               Primitive.ONE_INTEGER,
               Primitive.createInteger(nArgCount)});
      }
   }
View Full Code Here

Examples of nexj.core.scripting.ScriptingException

         {
            return symbol.evaluateNode(sValue, (Pair)expression, intArray, context);
         }
     }

     throw new ScriptingException("err.scripting.invalidMatchExpression",   // can get here
                                     new Object[] {expression});     // through a recursive call
   }
View Full Code Here

Examples of nexj.core.scripting.ScriptingException

         {
            return node;
         }
      }

      throw new ScriptingException("err.scripting.invalidMatchExpression",
                                      new Object[] {fault});
   }
View Full Code Here

Examples of nexj.core.scripting.ScriptingException

      if (attribute.isStatic())
      {
         return getValue(attribute.getOrdinal());
      }

      throw new ScriptingException("err.scripting.staticAttribute",
         new Object[]{attribute.getName(), getName()});
   }
View Full Code Here

Examples of nexj.core.scripting.ScriptingException

      if (attribute.isStatic())
      {
         return getValue(attribute.getOrdinal());
      }

      throw new ScriptingException("err.scripting.staticAttribute",
         new Object[]{attribute.getName(), getName()});
   }
View Full Code Here

Examples of nexj.core.scripting.ScriptingException

      {
         setValue(attribute.getOrdinal(), value);
      }
      else
      {
         throw new ScriptingException("err.scripting.staticAttribute",
            new Object[]{attribute.getName(), getName()});
      }
   }
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.