Skip to content

Invalid assignments in JSON parameter configuration file #67

@HolQue

Description

@HolQue

Based on

#66

I checked further use cases.

[1]

"teststring_variant" : "${a.1,b.2;c.3"

Error message: list index out of range

This error message seems to point to the origin of the problem, but in this case the error message does not help the user.
It's irrelevant for him that internally a list access went wrong. Maybe it's possible to improve the error message. In case of dollar operator and curly brackets have a syntactical meaning inside quotes, then the example above is a syntax violation, and not a list index problem. Maybe you count the number of opened and closed curly brackets inside a string. In case of different numbers: syntax error!

[2]

How to mask those special characters?

I tried: "\$\{a.1,b.2;c.3"

This is not accepted: Invalid \escape: line 10 column 51 (char 390)'

But I am not sure: Is this allowed?

[3]

This is accepted: "$$${a$}.1,b.2;c.3"

With meaningful error message: The variable '${a$}' is not available!

Curious, this is not accepted: "$$${a}.1,b.2;c.3"

Error message: Expecting ',' delimiter: line 10 column 54 (char 393)'

This does not help the users. Why not the same error message like in the example before (missing variable ${a})?

[4]

Robot Framework knows further operators do define values, e.g.: &.

"teststring_variant" : "$$ &{a$}.1,b.2;c.3"

Error message: Variable '${teststring_variant}' not found.

Astonishing. Seems that '&' is not allowed inside strings, or harms the parser. But it is unfavorable, that only the aftereffect (variable not found) is mentioned in the error message, but not the root cause (something invalid used or syntax violation within the assigned value).

Is it possible to detect the root cause and improve the error message?

Metadata

Metadata

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions