monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] making I(), E(), N() throw bad_decode for network d


From: Stephen Leake
Subject: Re: [Monotone-devel] making I(), E(), N() throw bad_decode for network data
Date: Tue, 11 Nov 2008 07:07:27 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Timothy Brownawell <address@hidden> writes:

> How about two sanity macros, and probably two or three exception types.
> One that's like I() is now, but only for verifying things that could not
> possibly have come from "outside" (which would include coming from the
> database). And one to use like E() and N(), but with another argument
> E(condition, *origin*, description), that would replace our current E()
> and N() and many uses of I(). "origin" could be network (exception will
> be handled by netsync event loop), user (result like N()), system (like
> E(), would be good for a lot of file_path errors), database (like I(),
> but probably with a different message), and internal (I() would become a
> shortcut for this). Probably this would mean to give informative_failure
> an origin flag and have subclasses for recoverable (network, user,
> system) and non-recoverable (internal, database) errors.

This sounds good. One downside is a lot of functions will now require
an 'origin' parameter to pass to the sanity macro.

-- 
-- Stephe




reply via email to

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