Elizabeth Grace Frank-Backman > SVN-Friendly > SVN::Friendly::Exceptions

Download:
SVN-Friendly-0.999_002.tar.gz

Dependencies

Annotate this POD

Source  

NAME ^

SVN::Friendly::Exceptions - Exception handling for the Subversion API

SYNOPSIS ^

   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
  }

DESCRIPTION ^

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.

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.

VERSION COMPATIBILITY ^

See SVN::Friendly.

CAVEATS ^

None to date.

KNOWN BUGS ^

None to date.

TO DO/ROADMAP ^

See SVN::Friendly

VOLUNTEERS ^

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.

SEE ALSO ^

See SVN::Friendly

AUTHOR ^

Elizabeth Grace Frank-Backman

COPYRIGHT ^

Copyright (c) 2008-2011 Elizabeth Grace Frank-Backman. All rights reserved.

LICENSE ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: