Hello,
I use xquery:eval to evaluate some user provided queries.
It works well but when there is an error the true origin of the error is hidden, as it will give the file and line of the xquery:eval call.
Is there any way to pass the origin of the error through the xquery:eval? I guess the best would be to keep both origins.
My workaround is to do a try/catch inside the evaluated query and wrap the result with the error variables. It's a bit cumbersome and does not work for static errors.
Thank you, Iwan
Dear Iwan,
Thanks for the feature proposal. As you may have seen, the xquery:parse function provides a 'pass' option, which can be used to pass on the original error info [1]. I have now added this option to xquery:eval [2], and to all other functions that support the same options. Feedback on the latest stable snapshot is welcome [3].
Cheers, Christian
[1] http://docs.basex.org/wiki/XQuery_Module#xquery:parse [2] http://docs.basex.org/wiki/XQuery_Module#xquery:eval [3] http://files.basex.org/releases/latest/
On Tue, Apr 18, 2017 at 11:28 AM, Iwan Briquemont tracnar@gmail.com wrote:
Hello,
I use xquery:eval to evaluate some user provided queries.
It works well but when there is an error the true origin of the error is hidden, as it will give the file and line of the xquery:eval call.
Is there any way to pass the origin of the error through the xquery:eval? I guess the best would be to keep both origins.
My workaround is to do a try/catch inside the evaluated query and wrap the result with the error variables. It's a bit cumbersome and does not work for static errors.
Thank you, Iwan
basex-talk@mailman.uni-konstanz.de