Closed whitlockjc closed 2 months ago
This issue is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity. This does not mean your issue is rejected, but rather it is done to hide it from the view of the maintains for the time being. Feel free to reopen if you have new comments
Whenever I try to compile or use an invalid XPath, while an error is returned as expected, two things happen that shouldn't be:
Here is the important part of my code:
The returned error will always/only contain
failed to compile expression: xpath compilation failed
but the inner error details are not available no matter how much I unwrap. Also, the inner error details always end up being written to stdout/stderr. Here is example output of my cobra CLI app that uses the code above:As you can see, the error my app returns does not contain the
XPath error
details and it is printed before my app prints anything related to the command returning an error. If I printed out the error returned byxpath.NewExpression
, it literally only containsfailed to compile expression: xpath compilation failed
whileXPath error: Expected $ for variable reference ...
is printed to stdout/stderr but not available by the provided error, nor is there any control on whether the detailed cause is printed at all.go version
go version go1.23-20240626-RC01