monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] comments on merging nvm.error-handling?


From: Zack Weinberg
Subject: Re: [Monotone-devel] comments on merging nvm.error-handling?
Date: Mon, 19 Jan 2009 19:37:29 -0800

On Sat, Jan 17, 2009 at 10:04 AM, Timothy Brownawell <address@hidden> wrote:
> net.venge.monotone.error-handling is meant to clean up our E(), I(), N()
> usage somewhat, so that for example receiving an invalid revision from
> the network will be treated differently than internally generating an
> invalid revision and won't crash the server.
>
> N() is gone, and E() takes an extra argument, E(condition, origin,
> message). The origin is an origin::type enum (see origin_type.hh), and
> indicates where the data causing the error is from. E(...,
> origin::user, ...) is equivalent to what N() was.
>
> All vocab types and most other classes now track where their data came
> from with a origin::type made_from member (which can be obtained by
> inheriting from origin_aware), and this is required when making a vocab
> type from a string (so "branch_name(arg())" won't work, but
> "branch_name(arg(), origin::user)" or "typecast_vocab<branch_name>(arg)"
> will work.
>
> This also removes informative_failure, and replaces it with
> recoverable_failure and unrecoverable_failure. Which one is thrown by
> E() depends on the origin, currently unrecoverable for internal and
> database origins, and recoverable for others.

I wanted to look through the code for this but I didn't have time.  I
like the concept, though, and we definitely need something along these
lines.  Go ahead and merge it :)

zw




reply via email to

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