You cannot use try catch, because the callstack that invokes the server request is not the callstack that receives the response (in other words, server requests are asynchronous).
You can receive errors by assigning a function to the "error" property of your arguments map, as you did for "callback". If everything is OK, callback will be invoked, otherwise, error will be invoked. But you will still see errounous netwerk requests in your log and stacktraces in your servers log.
So a much better approach is to pass the xpath string to the runtime and invoke a microflow that invokes a java action that executes the xpath and try-catch that. The Core exposes both synchronous and asynchronous API's to query data, and, above all, by catching your exceptions server side, you will not spam your log with exceptions.