Exception handling
In my example, I am calling xsltProcessor.compile(xsltLocation) where xsltLocation points to an invalid location. When doing this in Node.JS, even though compile() is wrapped in a try/catch, it is causing the application server to crash. Why is try/catch not catching the errors produced from saxon?
I'm experimenting with repeating this error. Earlier I tried to get the error state back from the saxon with
std::cout<<"exceptionOccurred "<<xp->xsltProcessor->exceptionOccurred()<<std::endl;
if(xp->xsltProcessor->exceptionOccurred() || xp->xsltProcessor->exceptionCount()>0){
std::string errorMessage="# of "+std::to_string(xp->xsltProcessor->exceptionCount());
v8::Isolate::GetCurrent()->ThrowException(v8::Exception::SyntaxError(String::NewFromUtf8(v8::Isolate::GetCurrent(), errorMessage.c_str())));
args.GetReturnValue().SetUndefined();
return;
}
but exceptionOccurred and exceptionCount never return anything and the exeption flies past.
checking if they are catchable...
oops; posted findings in the https://github.com/rimmartin/saxon-node/issues/7 thread
FYI: I'm developing Antlr v4 grammars for xsd and xslt. The http://www.antlr.org/download/antlr-javascript-runtime-4.5.1.zip generated lexer and parser seems fairly strong.
Can get all the xsd defaults and schema info. Not sure where I'm headed yet with this but I found the grammars fairly doable.
Is this thread and thread #7 the same? I am looking into the issue of Saxon/C crashing.
On Sat, Sep 5, 2015 at 3:52 AM, rimmartin [email protected] wrote:
FYI: I'm developing Antlr v4 grammars for xsd and xslt. The http://www.antlr.org/download/antlr-javascript-runtime-4.5.1.zip generated lexer and parser seems fairly strong.
Can get all the xsd defaults and schema info. Not sure where I'm headed yet with this but I found the grammars fairly doable.
— Reply to this email directly or view it on GitHub https://github.com/rimmartin/saxon-node/issues/9#issuecomment-137896411.
Hi @ond1, I posted to the wrong thread about trying to catch or connect to the error handling and exceptions.
What's the latest status of this?