Search in sources :

Example 6 with ConverterException

use of lucee.runtime.converter.ConverterException in project Lucee by lucee.

the class ToScript method call.

public static String call(PageContext pc, Object var, String jsName, boolean outputFormat, boolean asFormat) throws PageException {
    // if(!Decision.isVariableName(jsName))
    // throw new FunctionException(pc,"toScript",2,"jsName","value does not contain a valid variable String");
    JSConverter converter = new JSConverter();
    converter.useShortcuts(asFormat);
    converter.useWDDX(outputFormat);
    try {
        return converter.serialize(var, jsName);
    } catch (ConverterException e) {
        throw Caster.toPageException(e);
    }
}
Also used : ConverterException(lucee.runtime.converter.ConverterException) JSConverter(lucee.runtime.converter.JSConverter)

Aggregations

ConverterException (lucee.runtime.converter.ConverterException)6 IOException (java.io.IOException)3 JSONConverter (lucee.runtime.converter.JSONConverter)3 Charset (java.nio.charset.Charset)2 HashMap (java.util.HashMap)2 HTTPResponse (lucee.commons.net.http.HTTPResponse)2 ScriptConverter (lucee.runtime.converter.ScriptConverter)2 InputStream (java.io.InputStream)1 Log (lucee.commons.io.log.Log)1 MimeType (lucee.commons.lang.mimetype.MimeType)1 Header (lucee.commons.net.http.Header)1 PageContext (lucee.runtime.PageContext)1 PageSource (lucee.runtime.PageSource)1 ConfigImpl (lucee.runtime.config.ConfigImpl)1 JSConverter (lucee.runtime.converter.JSConverter)1 DebugTrace (lucee.runtime.debug.DebugTrace)1 DebuggerImpl (lucee.runtime.debug.DebuggerImpl)1 ThreadLocalPageContext (lucee.runtime.engine.ThreadLocalPageContext)1 Abort (lucee.runtime.exp.Abort)1 ApplicationException (lucee.runtime.exp.ApplicationException)1