( )⚙ D10009 rust: Add a `ConfigValueParseError` variant to common errors

This is an archive of the discontinued Mercurial Phabricator instance.

rust: Add a `ConfigValueParseError` variant to common errors
ClosedPublic

Authored by SimonSapin on Feb 17 2021, 7:58 AM.

Details

Summary

Configuration files are parsed into sections of key/value pairs when
they are read, but at that point values are still arbitrary bytes.
Only when a value is accessed by various parts of the code do we know
its expected type and syntax, so values are parsed at that point.

Let’s make a new error type for this latter kind of parsing error,
and add a variant to the common HgError so that most code can propagate it
without much boilerplate.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage