List of usage examples for javax.script ScriptException getLocalizedMessage
public String getLocalizedMessage()
From source file:org.apache.synapse.mediators.bsf.ScriptMessageContext.java
/** * Returns the JavaScript Object saved in this message context. * @param messageContext/*from w w w . ja v a2 s . c o m*/ * @return */ public Object jsonObject(MessageContext messageContext) { if (messageContext == null) { return null; } Object o = messageContext.getProperty(JSON_OBJECT); if (o == null) { logger.error("JSON object is null."); if (this.scriptEngine == null) { logger.error("Cannot create empty JSON object. ScriptEngine instance not available."); return null; } try { return this.scriptEngine.eval("({})"); } catch (ScriptException e) { logger.error("Could not return an empty JSON object. Error>>> " + e.getLocalizedMessage()); } } return o; }