Page MenuHomePhabricator

errors: use exit code 10 for parse errors
ClosedPublic

Authored by martinvonz on Mon, Nov 16, 7:27 PM.

Details

Summary

Now that ParseErrors raised while reading the config file has been
converted into ConfigErrors, the remaining parse errors should all
be "input errors" (i.e. exit code 10), according to
https://www.mercurial-scm.org/wiki/ErrorCategoriesPlan.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Mon, Nov 16, 7:27 PM
mharbison72 added inline comments.
tests/test-config.t
11 ↗(On Diff #23516)

Should these be Configuration/30 like the plan page says? (I'm fine with queueing this and refining it later, since it looks like this is serviced by the same code that is obviously an input error in other cases.) I wondered similar about the .hgsub parse errors above, but that's arguably an input rather than a config file I guess.

martinvonz planned changes to this revision.Thu, Nov 19, 12:09 PM
martinvonz added inline comments.
tests/test-config.t
11 ↗(On Diff #23516)

Good point. I'll see if I can refactor the code a bit so the ParseError gets converted to a ConfigError if it gets caught in the config code.

martinvonz marked an inline comment as done.Fri, Nov 20, 7:29 PM
martinvonz added inline comments.
tests/test-config.t
11 ↗(On Diff #23516)

This should now be done. I inserted 12 more patches before this one to handle the config errors.

martinvonz edited the summary of this revision. (Show Details)Sat, Nov 21, 1:35 AM
mharbison72 accepted this revision.Sat, Nov 21, 3:10 PM
This revision is now accepted and ready to land.Sat, Nov 21, 3:10 PM
This revision was automatically updated to reflect the committed changes.