On Thu, Jan 8, 2009 at 3:02 PM, Thomas Keller <[email protected]> wrote:
> We should try, right. Problem is that the invariant exists at two place
> (path_component::path_component(string const &d) and
> path_component::path_component(char const * d)) where the original error
> could either come from the inside (i.e. a roster) or the outside (i.e.
> the filesystem). To fix this one and for all time we could need
> something similar like what Timothy recently did with high-level data
> structures like revision: we'd need some kind of "origin" parameter.
> Yell with an invariant if the corrupt data come from the inside, because
> something broke, give the user a normal error when some external path is
> wrong.

The usual way we've handled this is to have the "outside" do the
checking with a nice error message, and then have the lower-level code
just I() on anything it can't handle (but never get called, if the
outside caught the problem first).  That means when you're looking at
the lower level code, you just have to worry about ensuring
correctness, and not be distracted by also trying to diagnose the
exact source of any incorrectness.

-- Nathaniel


_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to