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

[PATCH] include error codes in error messages (was: Re: [PATCH] Don't bother end users about HTTP requests)

From: Stefan Sperling <stsp_at_elego.de>
Date: Mon, 4 Feb 2008 20:50:45 +0100

On Sat, Feb 02, 2008 at 10:17:46AM -0500, Karl Fogel wrote:
> Now that there are search engines, it's possibly an argument for
> including the error code itself in error messages (even though that's
> always been held up as one of those ridiculous things engineers do
> that users hate). So:
>
> "Commit failed due to blah blah blah ... (svn error 26754)"
>
> I'm making up the syntax, but you get the idea. People could search
> for "svn error 26754" and presumably get helpful hits, and this would
> remain stable even when we change the human-readable part of the error
> message.

Attached is a diff that implements this.

It's a bit of a rough change, I had to fix quite a few tests that
matched end-of-line in expected output. Were possible I simply
made the expected-output regex eat the new " (svn error xyz)" part.

Also, I'm unsure about whether we should call the error codes
"svn error codes" or "apr error codes".

Arguments can be made both ways:

For users, "svn error code" is less surprising. But the code talks
about "apr errors" all the time, with subversion's own error codes
living in the user-definable part of the ARP error number space.

Maybe I should modify this patch so it calls real APR errors
"apr errors" and Subversion-specific errors "svn errors"?
But won't this confuse poor users again?

Bikeshed ahoy, mine's blue with spots of white sprinkled here and there.

[[[

Print error codes in error messages.

Proposed by Karl in http://svn.haxx.se/dev/archive-2008-02/0084.shtml
after he suddenly discovered google et al:

  Now that there are search engines, it's possibly an argument for
  including the error code itself in error messages (even though that's
  always been held up as one of those ridiculous things engineers do
  that users hate). So:
  
     "Commit failed due to blah blah blah ... (svn error 26754)"
  
  I'm making up the syntax, but you get the idea. People could search
  for "svn error 26754" and presumably get helpful hits, and this would
  remain stable even when we change the human-readable part of the error
  message.

* subversion/libsvn_subr/error.c
  (SVN_FILE_LINE_UNDEFINED): Include a colon here that used to
    be printed along with a format string which was removed.
  (print_error): Append APR error code along with all error messages.

* subversion/tests/cmdline/switch_tests.py
  (commit_routine_switching, forced_switch_failures): Fix these tests,
   they were broken by the changes made to libsvn_subr/error.c.

* subversion/tests/cmdline/diff_tests.py
  (diff_non_version_controlled_file): ditto

* subversion/tests/cmdline/prop_tests.py
  (inappropriate_props): ditto

* subversion/tests/cmdline/commit_tests.py
  (set_invalid_revprops, start_commit_hook_test, pre_commit_hook_test): ditto

* subversion/tests/cmdline/checkout_tests.py
  (co_with_obstructing_local_adds): ditto
]]]

-- 
Stefan Sperling <stsp_at_elego.de>                 Software Developer
elego Software Solutions GmbH                            HRB 77719
Gustav-Meyer-Allee 25, Gebaeude 12        Tel:  +49 30 23 45 86 96 
13355 Berlin                              Fax:  +49 30 23 45 86 95
http://www.elego.de                 Geschaeftsfuehrer: Olaf Wagner

  • application/pgp-signature attachment: stored
Received on 2008-02-04 20:51:03 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.