Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The error stack is inaccurate when using a query with a filter that doesn't return any result #3432

Open
lepapareil opened this issue Nov 22, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lepapareil
Copy link
Collaborator

Steps to reproduce

Create /tmp/test.hurl file :

GET https://hurl.dev/broken
HTTP 404
[Captures]
id: xpath "string(//span[@class='comment'])"

Executing hurl --test /tmp/test.hurl must succeed :

/tmp/test.hurl: Success (1 request(s) in 321 ms)

Then update /tmp/test.hurl file, adding a non-working regex filter :

GET https://hurl.dev/broken
HTTP 404
[Captures]
id: xpath "string(//span[@class='comment'])" regex "this regex does not work"

Executing hurl --test /tmp/test.hurl must fail, but the error stack is on the query instead of the filter :

error: No query result
  --> /tmp/test.hurl:4:5
   |
   | GET https://hurl.dev/broken
   | ...
 4 | id: xpath "string(//span[@class='comment'])" regex "this regex does not work"
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The query didn't return any result
   |

/tmp/test.hurl: Failure (1 request(s) in 323 ms)

What is the expected correct behavior?

error: No query result
  --> /tmp/test.hurl:4:5
   |
   | GET https://hurl.dev/broken
   | ...
 4 | id: xpath "string(//span[@class='comment'])" regex "this regex does not work"
   |                                              ^^^^^ The filter didn't return any result
   |

/tmp/test.hurl: Failure (1 request(s) in 323 ms)

Execution context

  • Hurl Version (hurl --version): 5.0.1
@lepapareil lepapareil added the bug Something isn't working label Nov 22, 2024
@lepapareil lepapareil changed the title The error stack is incorrect when using a query with a filter that doesn't return any result The error stack is inaccurate when using a query with a filter that doesn't return any result Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant