How can a SVN::Error callback identify the context from which it was called
Posted
by Colin Fine
on Stack Overflow
See other posts from Stack Overflow
or by Colin Fine
Published on 2010-04-14T16:47:39Z
Indexed on
2010/04/14
16:53 UTC
Read the original article
Hit count: 265
I've written some fairly extensive Perl modules and scripts using the Perl bindings SVN::Client etc. Since the calls to SVN::Client are all deep in a module, I have overridden the default error handling.
So far I have done so by setting $SVN::Error::handler = undef as described in [1], but this makes the individual calls a bit messy because you have to remember to make each call to SVN::Client in list context and test the first value for errors.
I would like to switch to using an error handler I would write; but $SVN::Error::handler is global, so I can't see any way that my callback can determine where the error came from, and what object to set an error code in.
I wondered if I could use a pool for this purpose: so far I have ignored pools as irrelevant to working in Perl, but if I call a SVN::Client method with a pool I have created, will any SVN::Error object be created in the same pool?
Has anybody any knowledge or experience which bears on this?
[1]: http://search.cpan.org/~mschwern/Alien-SVN-1.4.6.0/src/subversion/subversion/bindings/swig/perl/native/Core.pm#svn_error_t_-_SVN::Error SVN::Core POD
© Stack Overflow or respective owner