fix: handle tokenizer error in config file #10259
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem was that tokenizer returned a tuple
{1, {erl_scan, {illegel, integer}}}
tuple which was converted to a list but~ts
inio_lib:format
requiredunicode
andstring
modules.Also, tokenizer error is now matched to embed line number correctly. I assume that tokenizer can't return
eof
when being run without continuation as first param so I didn't match that clause.Error message you'll get for
sys.config
that contains7k
is the following:Could not start kernel pid (application_controller) ("error in config file \"/tmp/sys.config\" (1): {erl_scan,{illegal,integer}}")
I tried testing this in the
application_controller_SUITE
but with no success - I tried starting slave node and match on error message, but I only gottimeout
. Anyone got an idea on how to test this?Submitting fix to
master
branch because it occurred after in OTP28.Ping @eproxus
Props to @richcarl for posting hints on what's going on.
Closes #10214