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

Add request context when outputing error #2351

Closed
jcamiel opened this issue Jan 24, 2024 · 0 comments · Fixed by #2358
Closed

Add request context when outputing error #2351

jcamiel opened this issue Jan 24, 2024 · 0 comments · Fixed by #2358
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jcamiel
Copy link
Collaborator

jcamiel commented Jan 24, 2024

The current Hurl output when outputting error is to display the source line where the error has happened:

...
foo.hurl: Running [9/12]
error: Assert status code
   --> foo.hurl:78:6
    |
 78 | HTTP 200
    |      ^^^ actual value is <404>
    |

foo.hurl: Failure (5 request(s) in 411 ms)  

It can be difficult to identify the request without reading the source file. To help this, we could print the curent request line:

...
foo.hurl: Running [9/12]
error: Assert status code
   --> foo.hurl:78:6
    |
 73 | GET {{orange_url}}/api/filters
    | ...
 78 | HTTP 200
    |      ^^^ actual value is <404>
    |

foo.hurl: Failure (5 request(s) in 329 ms)

If the error happens on a request line (like timeout, etc... we don't need to change anything

@jcamiel jcamiel added the enhancement New feature or request label Jan 24, 2024
@jcamiel jcamiel added this to the 4.3.0 milestone Jan 24, 2024
@jcamiel jcamiel self-assigned this Jan 24, 2024
@jcamiel jcamiel linked a pull request Jan 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant