Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1490,7 +1490,7 @@ will follow a redirection only for the second entry.
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <a href="#color" id="color"><code>--color</code></a> | Colorize standard output and standard error.<br><br>By default, Hurl outputs a prettified and colorized response. When redirected through pipes, standard streams are not colorized and color can be forced with this option.<br><br>Environment variables: HURL_COLOR<br><br>This is a cli-only option.<br> |
| <a href="#curl" id="curl"><code>--curl &lt;FILE&gt;</code></a> | Export each request to a list of curl commands.<br><br>This is a cli-only option.<br> |
| <a href="#error-format" id="error-format"><code>--error-format &lt;FORMAT&gt;</code></a> | Control the format of error message (short by default or long). When using long,<br>the response body is logged when there are errors.<br><br>This is a cli-only option.<br> |
| <a href="#error-format" id="error-format"><code>--error-format &lt;FORMAT&gt;</code></a> | Control the format of error message (short by default or long). When using long, the response body is logged when there are errors.<br><br>Environment variables: HURL_ERROR_FORMAT<br><br>This is a cli-only option.<br> |
| <a href="#include" id="include"><code>-i, --include</code></a> | Include the HTTP headers in the output<br><br>This is a cli-only option.<br> |
| <a href="#json" id="json"><code>--json</code></a> | Output each Hurl file result to JSON. The format is very closed to HAR format.<br><br>This is a cli-only option.<br> |
| <a href="#no-color" id="no-color"><code>--no-color</code></a> | Do not colorize standard output nor standard error.<br><br>Environment variables: HURL_NO_COLOR NO_COLOR<br><br>This is a cli-only option.<br> |
Expand Down
2 changes: 1 addition & 1 deletion docs/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ will follow a redirection only for the second entry.
|------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <a href="#color" id="color"><code>--color</code></a> | Colorize standard output and standard error.<br><br>By default, Hurl outputs a prettified and colorized response. When redirected through pipes, standard streams are not colorized and color can be forced with this option.<br><br>Environment variables: HURL_COLOR<br><br>This is a cli-only option.<br> |
| <a href="#curl" id="curl"><code>--curl &lt;FILE&gt;</code></a> | Export each request to a list of curl commands.<br><br>This is a cli-only option.<br> |
| <a href="#error-format" id="error-format"><code>--error-format &lt;FORMAT&gt;</code></a> | Control the format of error message (short by default or long). When using long,<br>the response body is logged when there are errors.<br><br>This is a cli-only option.<br> |
| <a href="#error-format" id="error-format"><code>--error-format &lt;FORMAT&gt;</code></a> | Control the format of error message (short by default or long). When using long, the response body is logged when there are errors.<br><br>Environment variables: HURL_ERROR_FORMAT<br><br>This is a cli-only option.<br> |
| <a href="#include" id="include"><code>-i, --include</code></a> | Include the HTTP headers in the output<br><br>This is a cli-only option.<br> |
| <a href="#json" id="json"><code>--json</code></a> | Output each Hurl file result to JSON. The format is very closed to HAR format.<br><br>This is a cli-only option.<br> |
| <a href="#no-color" id="no-color"><code>--no-color</code></a> | Do not colorize standard output nor standard error.<br><br>Environment variables: HURL_NO_COLOR NO_COLOR<br><br>This is a cli-only option.<br> |
Expand Down
7 changes: 4 additions & 3 deletions docs/manual/hurl.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH hurl 1 "09 Mar 2026" "hurl 8.0.0-SNAPSHOT" " Hurl Manual"
.TH hurl 1 "13 Mar 2026" "hurl 8.0.0-SNAPSHOT" " Hurl Manual"
.SH NAME

hurl - run and test HTTP requests.
Expand Down Expand Up @@ -332,8 +332,9 @@ This is a cli-only option.

.IP "--error-format <FORMAT> "

Control the format of error message (short by default or long). When using long,
the response body is logged when there are errors.
Control the format of error message (short by default or long). When using long, the response body is logged when there are errors.

Environment variables: HURL_ERROR_FORMAT

This is a cli-only option.

Expand Down
5 changes: 3 additions & 2 deletions docs/manual/hurl.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,9 @@ This is a cli-only option.

#### --error-format <FORMAT> {#error-format}

Control the format of error message (short by default or long). When using long,
the response body is logged when there are errors.
Control the format of error message (short by default or long). When using long, the response body is logged when there are errors.

Environment variables: HURL_ERROR_FORMAT

This is a cli-only option.

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/hurlfmt.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH hurl 1 "09 Mar 2026" "hurl 8.0.0-SNAPSHOT" " Hurl Manual"
.TH hurl 1 "13 Mar 2026" "hurl 8.0.0-SNAPSHOT" " Hurl Manual"
.SH NAME

hurlfmt - format Hurl files
Expand Down
4 changes: 2 additions & 2 deletions docs/spec/options/hurl/error_format.option
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ value_parser: ["short", "long"]
help: Control the format of error messages
help_heading: Output options
cli_only: true
env_var: HURL_ERROR_FORMAT
---
Control the format of error message (short by default or long). When using long,
the response body is logged when there are errors.
Control the format of error message (short by default or long). When using long, the response body is logged when there are errors.
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
* Request can be run with the following curl command:
* curl 'http://localhost:8000/error-format-long/html'

HTTP/1.1 200
Content-Length: 45
Content-Type: text/html; charset=utf-8
Date: <<<.*?>>>
Server: Flask Server
Via: waitress

<html><head><title>Test</title></head></html>

error: Assert header value
--> tests_failed/error_format_long/error_format_long.hurl:7:15
|
| GET http://localhost:8000/error-format-long/html
| ...
7 | Content-Type: text/html
| ^^^^^^^^^ actual value is <text/html; charset=utf-8>
|

error: Assert failure
--> tests_failed/error_format_long/error_format_long.hurl:9:0
|
| GET http://localhost:8000/error-format-long/html
| ...
9 | xpath "string(//head/title)" == "Welcome!"
| actual: string <Test>
| expected: string <Welcome!>
|

error: Assert failure
--> tests_failed/error_format_long/error_format_long.hurl:11:0
|
| GET http://localhost:8000/error-format-long/html
| ...
11 | xpath "//title" count == 2
| actual: integer <1>
| expected: integer <2>
|

* Request can be run with the following curl command:
* curl 'http://localhost:8000/error-format-long/json'

HTTP/1.1 200
Content-Length: 115
Content-Type: application/json
Date: <<<.*?>>>
Server: Flask Server
Via: waitress

{"books": [{"name": "Dune", "author": "Franck Herbert"}, {"name": "Les Mis\u00e9rables", "author": "Victor Hugo"}]}

error: Assert failure
--> tests_failed/error_format_long/error_format_long.hurl:18:0
|
| GET http://localhost:8000/error-format-long/json
| ...
18 | jsonpath "$.books" count == 12
| actual: integer <2>
| expected: integer <12>
|

* Request can be run with the following curl command:
* curl 'http://localhost:8000/error-format-long/rfc-7807'

HTTP/1.1 200
Content-Length: 258
Content-Type: application/problem+json
Date: <<<.*?>>>
Server: Flask Server
Via: waitress

{"type": "https://example.com/probs/out-of-credit", "title": "You do not have enough credit.", "detail": "Your current balance is 30, but that costs 50.", "instance": "/account/12345/msgs/abc", "balance": 30, "accounts": ["/account/12345", "/account/67890"]}

error: Assert failure
--> tests_failed/error_format_long/error_format_long.hurl:26:0
|
| GET http://localhost:8000/error-format-long/rfc-7807
| ...
26 | jsonpath "$.title" == "You have enough credit."
| actual: string <You do not have enough credit.>
| expected: string <You have enough credit.>
|

* Request can be run with the following curl command:
* curl 'http://localhost:8000/error-format-long/fhir'

HTTP/1.1 200
Content-Length: 902
Content-Type: application/fhir+json
Date: <<<.*?>>>
Server: Flask Server
Via: waitress

{"resourceType": "Practitioner", "id": "example", "text": {"status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <p>Dr Adam Careful is a Referring Practitioner for Acme Hospital from 1-Jan 2012 to 31-Mar\n 2012</p>\n </div>"}, "identifier": [{"system": "http://www.acme.org/practitioners", "value": "23"}], "active": true, "name": [{"family": "Careful", "given": ["Adam"], "prefix": ["Dr"]}], "address": [{"use": "home", "line": ["534 Erewhon St"], "city": "PleasantVille", "state": "Vic", "postalCode": "3999"}], "qualification": [{"identifier": [{"system": "http://example.org/UniversityIdentifier", "value": "12345"}], "code": {"coding": [{"system": "http://terminology.hl7.org/CodeSystem/v2-0360/2.7", "code": "BS", "display": "Bachelor of Science"}], "text": "Bachelor of Science"}, "period": {"start": "1995"}, "issuer": {"display": "Example University"}}]}

error: Assert failure
--> tests_failed/error_format_long/error_format_long.hurl:34:0
|
| GET http://localhost:8000/error-format-long/fhir
| ...
34 | jsonpath "$.id" == "foo"
| actual: string <example>
| expected: string <foo>
|

* Request can be run with the following curl command:
* curl 'http://localhost:8000/error-format-long/csv'

HTTP/1.1 200
Content-Length: 726
Content-Type: text/csv; charset=utf-8
Date: <<<.*?>>>
Server: Flask Server
Via: waitress

"Year","Score","Title"
1968,86,"Greetings"
1970,17,"Bloody Mama"
1970,73,"Hi, Mom!"
1971,40,"Born to Win"
1973,98,"Mean Streets"
1973,88,"Bang the Drum Slowly"
1974,97,"The Godfather, Part II"
1976,41,"The Last Tycoon"
1976,99,"Taxi Driver"
1977,47,"1900"
1977,67,"New York, New York"
1978,93,"The Deer Hunter"
1980,97,"Raging Bull"
1981,75,"True Confessions"
1983,90,"The King of Comedy"
1984,89,"Once Upon a Time in America"
1984,60,"Falling in Love"
1985,98,"Brazil"
1986,65,"The Mission"
1987,00,"Dear America: Letters Home From Vietnam"
1987,80,"The Untouchables"
1987,78,"Angel Heart"
1988,96,"Midnight Run"
1989,64,"Jacknife"
1989,47,"We're No Angels"
1990,88,"Awakenings"
1990,29,"Stanley & Iris"
1990,96,"Goodfellas"


error: Assert failure
--> tests_failed/error_format_long/error_format_long.hurl:42:0
|
| GET http://localhost:8000/error-format-long/csv
| ...
42 | body split "\n" nth 9 split "," nth 2 == "\"Taxi\""
| actual: string <"Taxi Driver">
| expected: string <"Taxi">
|

* Request can be run with the following curl command:
* curl 'http://localhost:8000/error-format-long/bytes'

HTTP/1.1 200
Content-Length: 4
Content-Type: application/octet-stream
Date: <<<.*?>>>
Server: Flask Server
Via: waitress

Bytes <deadbeef...>

error: Assert failure
--> tests_failed/error_format_long/error_format_long.hurl:50:0
|
| GET http://localhost:8000/error-format-long/bytes
| ...
50 | bytes == hex,beef;
| actual: bytes <deadbeef>
| expected: bytes <beef>
|

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Set-StrictMode -Version latest
$ErrorActionPreference = 'Stop'

$env:HURL_ERROR_FORMAT = 'long'
hurl --continue-on-error tests_failed/error_format_long/error_format_long.hurl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -Eeuo pipefail

export HURL_ERROR_FORMAT=long
hurl --continue-on-error tests_failed/error_format_long/error_format_long.hurl
Loading
Loading