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

Detecting unhandled errors, WAS: RE: svn commit: rev 7373 - trunk/subversion/libsvn_client

From: Sander Striker <s.striker_at_striker.nl>
Date: 2003-10-10 21:24:29 CEST

> From: Philip Martin [mailto:philip@codematters.co.uk]
> Sent: Friday, October 10, 2003 9:12 PM

> cmpilato@tigris.org writes:
>
> > Author: cmpilato
> > Date: Fri Oct 10 12:42:22 2003
> > New Revision: 7373
> >
> > Modified:
> > trunk/subversion/libsvn_client/commit.c
> > Log:
> > * subversion/libsvn_client/commit.c
> > (import_dir): Clear the error if you're not going to use it.
>
> Perhaps we could detect these automatically? I'm thinking of a pool
> cleanup handler installed when the error is created, removed when the
> error is cleared/handled and which triggers a diagnostic if the error
> is unhandled when the pool is destroyed.

Oh... nice!

My vote is for:

static apr_status_t err_abort(void *data)
{
  abort();
}

In the error creation code:

  apr_pool_cleanup_register(err->pool, NULL, err_abort, NULL);

And:

svn_error_clear (svn_error_t *err)
{
  if (err)
    {
      apr_pool_cleanup_kill(err->pool, NULL, err_abort);
      apr_pool_destroy (err->pool);
    }
}

Sander
                            

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Oct 10 21:25:25 2003

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.