Error-Hierarchy
view release on metacpan or search on metacpan
lib/Error/Hierarchy/Internal/DBI.pm view on Meta::CPAN
my $dbuser = '...';
my $dbpass = '...';
my $dbh = DBI->connect($connect_string, $dbuser, $dbpass,
{ HandleError => Error::Hierarchy::Internal::DBI->handler });
=head1 DESCRIPTION
This class is the main part of the DBI-related exceptions. If you set it as
the error handler in a C<DBI->connect()> call, it will turn the simple string
errors thrown by DBI (and the database) into more meaningful exceptions.
=head1 METHODS
=head2 init
Initializes a newly constructed exception object. It transmutes the exception,
then calls C<emit_warning()> on the object.
=head2 transmute_exception
Give subclasses a chance to turn generic DBI exceptions into something more
specific for their database schema. This method is supposed to bless the
exception into the desired package or create a new one and must return it; it
is called in C<init()>.
=head2 emit_warning
Warns via C<warn()> unless the package global C<SkipWarning> is set.
=head2 handler
Turns the DBI error into the appropriate C<Error::Hierarchy::Internal::DBI::*>
exception object.
=head1 PROPERTIES
This exception class inherits all properties of
L<Error::Hierarchy::Internal::CustomMessage>.
It has the following additional properties.
=over 4
=item C<error>
=item C<err>
=item C<errstr>
=item C<state>
=item C<retval>
=back
=head1 INSTALLATION
See perlmodinstall for information and options on installing Perl modules.
=head1 BUGS AND LIMITATIONS
No bugs have been reported.
Please report any bugs or feature requests through the web interface at
L<http://rt.cpan.org/Public/Dist/Display.html?Name=Error-Hierarchy>.
=head1 AVAILABILITY
The latest version of this module is available from the Comprehensive Perl
Archive Network (CPAN). Visit L<http://www.perl.com/CPAN/> to find a CPAN
site near you, or see L<http://search.cpan.org/dist/Error-Hierarchy/>.
The development version lives at L<http://github.com/hanekomu/Error-Hierarchy>
and may be cloned from L<git://github.com/hanekomu/Error-Hierarchy>.
Instead of sending patches, please fork this project using the standard
git and github infrastructure.
=head1 AUTHOR
Marcel Gruenauer <marcel@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2004 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 1.755 second using v1.01-cache-2.11-cpan-39bf76dae61 )