test-fullautomation / python-jsonpreprocessor

A preprocessor for json files
Apache License 2.0
2 stars 2 forks source link

Incomplete error message #288

Open HolQue opened 1 month ago

HolQue commented 1 month ago

In most of the cases, error messages contain a reason for the format being invalid, e.g.:

errorMsg = f"Invalid parameter format: {sInput} - The double quotes are missing!!!"

But the code contains also this:

if sInput.count("{") != sInput.count("}") or sInput.count("[") != sInput.count("]"):
    errorMsg = f"Invalid parameter format: {sInput.strip()}"

I would say, also here the reason (bracket mismatch) should be printed out, because the reason is known.

Is there a certain reason to count if sInput.count("{") instead of if sInput.count("${") like at other positions?