[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] include error codes in error messages

From: Branko ─îibej <brane_at_xbc.nu>
Date: Wed, 06 Feb 2008 22:21:54 +0100

Karl Fogel wrote:
> Stefan Sperling <stsp_at_elego.de> writes:
>
>> Bit ugly alright:
>>
>> stsp_at_ted [tmp] $ svnadmin create repos
>> svnadmin: Repository creation failed (svn error 200011)
>> svnadmin: Could not create top-level directory (svn error 200011)
>> svnadmin: 'repos' exists and is non-empty (svn error 200011)
>> [...]
>>
>> I also think including only the number of the outermost error would
>> look nicer. But it would defeat Karl's point a bit, wouldn't it?
>> What if the error the user wants to search for is not the outermost one?
>>
>
> Dang.
>
> Seeing this output makes me think this is too much visual noise to be
> worth it. I want to conclude otherwise, but can't. I think we
> shouldn't do this, sorry...
>

When we walk down the stack of errors during display, we should show
only those error codes that are different from the previous displayed
one. IOW always show the top-level code, but show wrapped codes only if
they're different from the wrapper's.

Another thing that strikes me is that the whole errror number, e.g.
200011 in the example above, is quite and completely useless; because
you never *see* that number in the code! You see some constant + 11, so
this display is quite useless for searching for the cause.

Since the code knows those APR constants, IMHO it should turn them into
mnemonics and show only the relevant part of the error code; e.g., for
codes below APR_OS_START_USERERR, you could use

    ("A%d", code)

and for codes above that,

    ("S%d", code - APR_OS_START_USERERR)

Not quite that simple as this would also be useless since we also define
a number of category constants and reserve a large interval for each
category; so the display code would ideally be smart enough to invent
different mnemonics for each category, and maintain that mapping as we
add categories.

But whoever said a sane user interface could be written with little code
and less effort?

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-02-06 22:22:21 CET

This is an archived mail posted to the Subversion Dev mailing list.