> -----Original Message-----
> From: danielsh_at_apache.org [mailto:danielsh_at_apache.org]
> Sent: maandag 13 mei 2013 14:43
> To: commits_at_subversion.apache.org
> Subject: svn commit: r1481827 - /subversion/trunk/subversion/libsvn_fs/fs-
> loader.c
>
> Author: danielsh
> Date: Mon May 13 12:42:57 2013
> New Revision: 1481827
>
> URL: http://svn.apache.org/r1481827
> Log:
> * subversion/libsvn_fs/fs-loader.c
> (default_warning_func): Try and print something anyway before abort()ing.
>
> Modified:
> subversion/trunk/subversion/libsvn_fs/fs-loader.c
>
> Modified: subversion/trunk/subversion/libsvn_fs/fs-loader.c
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs/fs-
> loader.c?rev=1481827&r1=1481826&r2=1481827&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/libsvn_fs/fs-loader.c (original)
> +++ subversion/trunk/subversion/libsvn_fs/fs-loader.c Mon May 13 12:42:57
> 2013
> @@ -373,7 +373,12 @@ default_warning_func(void *baton, svn_er
> {
> /* The one unforgiveable sin is to fail silently. Dumping to stderr
> or /dev/tty is not acceptable default behavior for server
> - processes, since those may both be equivalent to /dev/null. */
> + processes, since those may both be equivalent to /dev/null.
> +
> + That said, be a good citizen and print something anyway, in case it goes
> + somewhere.
> + */
> + svn_handle_error2(err, stderr, FALSE /* fatal */, "svn: fs-loader: ");
> SVN_ERR_MALFUNCTION_NO_RETURN();
-0.5
This should be part of 'svn', not libsvn_<something>, by installing a warning function.
(At least not in non maintainer builds)
The proper way to handle errors is to install a callback. Even a malfunction-no-return is catchable for our users and a library should *never* just try to do something, to ease debugging.
SVN_ERR_MALFUNCTION_NO_RETURN() is no abort. It is a callback that can be handled (and then continue) via a jump or something like a C++ exception.
Bert
Received on 2013-05-13 14:49:15 CEST