Package org.openhab.core.scriptengine

Examples of org.openhab.core.scriptengine.ScriptExecutionException


          if(result==null) {
            // this can only happen on an InterpreterCancelledException, i.e. NEVER ;-)
            return null;
          }
          if (result.getException() != null) {
              throw new ScriptExecutionException(result.getException().getMessage(), result.getException());
          }
          return result.getResult();
        } catch(Throwable e) {
          if(e instanceof ScriptExecutionException) {
            throw (ScriptExecutionException) e;
          } else {
            throw new ScriptExecutionException("An error occured during the script execution: " + e.getMessage(), e);
          }
        }
    } else {
          throw new ScriptExecutionException("Script does not contain any expression");
    }
  }
View Full Code Here


        ScriptEngine scriptEngine = ScriptActivator.scriptEngineTracker.getService();
        if(scriptEngine!=null) {
          Script script = scriptEngine.newScriptFromXExpression(expr);
          return script.execute();
        } else {
          throw new ScriptExecutionException("Script engine is not available.");
        }
      } else {
        throw new ScriptExecutionException("Script '" + scriptName + "' cannot be found.");
      }
    } else {
      throw new ScriptExecutionException("Model repository is not available.");
    }
  }
View Full Code Here

TOP

Related Classes of org.openhab.core.scriptengine.ScriptExecutionException

Copyright © 2018 www.massapicom. 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.