SVN::Friendly::Exceptions - Exception handling for the Subversion API
use SVN::Friendly::Exceptions qw(makeErrorHandler); sub myWonderfulSubversionRoutine { # define a custom handler my $crCustom = sub { my ($oSwigErr) = @_; if ( ... discard conditions...) { # exception will be ignored and processing will continue return 1; } elsif (... pass through conditions ...) { # exception will be handled by default error handler return 0; } else { # rethrow -or- manufacture own exception and die } } # temporarily install a custom handler for your subvrsion # calls local $SVN::Error::handler = makeErrorHandler($crCustom); # make some subversion API calls }
This class defines tools for taking control over subversion's error handling.
In the C-API errors are handled by return values. The subversion Perl bindings use return values to return actual values. Errors and exceptions are handled via an error handling hook.
By default, this hook simply dies when an error or exception is found. You can change that behavior by setting $SVN::Error::handler to the code reference of a subroutine of your choice.
$SVN::Error::handler
In most cases you will only want to change the behvior for a small subset of exceptions. If this is the case you can use makeErrorHandler to define a custom routine. This routine takes a single parameter, the swig error. You can choose to discard the exception, pass it on to the default handler, or even throw your own exception.
makeErrorHandler
See SVN::Friendly.
None to date.
See SVN::Friendly
If anyone would like to be involved in testing or expanding the user friendly interface, please contact the maintainer.
Feedback on the documentation, bugs, usability, or additional features desired is welcome. Time and person-power permitting the most commonly requested features will be implemented.
Elizabeth Grace Frank-Backman
Copyright (c) 2008-2011 Elizabeth Grace Frank-Backman. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install SVN::Friendly::Dates, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SVN::Friendly::Dates
CPAN shell
perl -MCPAN -e shell install SVN::Friendly::Dates
For more information on module installation, please visit the detailed CPAN module installation guide.