monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] bug in monotone


From: Nathaniel Smith
Subject: Re: [Monotone-devel] bug in monotone
Date: Thu, 8 Jan 2009 21:12:23 -0800

On Thu, Jan 8, 2009 at 3:02 PM, Thomas Keller <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]