I want to create a IXI module and there is something wrong " ERROR com.iota.iri.IXI - Script error".
How can I tell IRI to just log the exact error of my IXI script? I just want to know which line contains the error.
Iota Stack Exchange is a question and answer site for users of Iota, the open-source cryptocurrency for IoT that does not use a blockchain. It only takes a minute to sign up.
Sign up to join this communityUnfortunately, there is no configuration parameter or runtime flag available to enable more explicit logging for IXI modules.
What you can do is modifying the code in IXI.java to have more details. Of course you need to recompile the IRI.
Here is an example of what you can do in IXI.java :
Replace those lines of code in IXI.java (line 256)
try {
scriptEngine.eval(ixiModuleReader, bindings);
} catch (ScriptException e) {
log.error("Script error");
}
by this code to get more details about script errors:
try {
scriptEngine.eval(ixiModuleReader, bindings);
} catch (ScriptException e) {
log.error("Script error. Root cause:"+(e.getCause()==null?"unknown":e.getCause())+"\n"+
"Details: \n"+
"\tfile:"+e.getFileName()+"\n"+
"\tline:"+e.getLineNumber()+"\n"+
"\tcolumn:"+e.getColumnNumber()+"\n"+
"\tmessage:"+e.getMessage() +"\n"+
"\troot cause message:"+(e.getCause()==null?"unavailable":e.getCause().getMessage()),
e);
}