Orange-OpenSource / hurl

Hurl, run and test HTTP requests with plain text.
https://hurl.dev
Apache License 2.0
12.56k stars 473 forks source link

Type parsing error for [Options] items are not explicit #2925

Closed lepapareil closed 2 months ago

lepapareil commented 2 months ago

What is the current bug behavior?

When using a string instead of an int for some [Options] items, I get an error message that is not explicit:

11 | retry: {{retry}}
   |          ^^^^^ expecting integer, actual value is <60851>

In this message I think that actual value is an integer so I don't understand why it breaks.

Steps to reproduce:

GET https://hurl.dev

HTTP 200

[Captures]
retry: header "content-length"

GET https://hurl.dev

[Options]
retry: {{retry}}

HTTP 200
error: Invalid variable type
  --> test.hurl:11:10
   |
   | GET https://hurl.dev
   | ...
11 | retry: {{retry}}
   |          ^^^^^ expecting integer, actual value is <60851>
   |

What is the expected correct behavior?

I expect to have the same format for parsing types error as [Asserts] does :

error: Invalid variable type
  --> test.hurl:11:10
   |
   | GET https://hurl.dev
   | ...
11 | retry: {{retry}}
   |          ^^^^^ actual:   string <98>
   |                expected: int <98>
   |

Execution context