Java Script getScriptCompileMsg(ScriptException ex)

Here you can find the source of getScriptCompileMsg(ScriptException ex)

Description

get Script Compile Msg

License

Open Source License

Declaration

public static String getScriptCompileMsg(ScriptException ex) 

Method Source Code


//package com.java2s;
/*/*  w w w  . j a  v  a2 s .c  om*/
 * *************************************************************************************
 *  Copyright (C) 2008 EsperTech, Inc. All rights reserved.                            *
 *  http://esper.codehaus.org                                                          *
 *  http://www.espertech.com                                                           *
 *  ---------------------------------------------------------------------------------- *
 *  The software in this package is published under the terms of the GPL license       *
 *  a copy of which has been included with this distribution in the license.txt file.  *
 * *************************************************************************************
 */

import javax.script.*;

public class Main {
    public static String getScriptCompileMsg(ScriptException ex) {
        if (ex.getLineNumber() != 1 && ex.getColumnNumber() != -1) {
            return "At line " + ex.getLineNumber() + " column " + ex.getColumnNumber() + ": " + ex.getMessage();
        } else {
            return ex.getMessage();
        }
    }
}

Related

  1. fillStringCollection(ScriptObjectMirror som, Collection collection)
  2. generateToken(String val)
  3. getBallerinaFromJsonModel(String jsonModel)
  4. getDynamicInput(String key)
  5. getScript(String name)
  6. getSpParamOfWeiboLogin(String pwd, String servicetime, String nonce)
  7. removeScript(String name)
  8. runScript(final String script)
  9. toMap(ScriptObjectMirror som, Class type)