1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
# $Id$
package Data::ObjectDriver::Errors;
use strict;
use warnings;
use constant UNIQUE_CONSTRAINT => 1;
1;
__END__
=head1 NAME
Data::ObjectDriver::Errors - container class for common database error codes
=head1 SYNOPSIS
eval { $driver->insert($obj); };
if ($@ && $driver->last_error() == Data::ObjectDriver::Errors->UNIQUE_CONSTRAINT) {
...
=head1 DESCRIPTION
I<Data::ObjectDriver::Errors> is a container class for error codes resulting
from DBI database operations. Database drivers can map particular database
servers' DBI errors to these constants with their C<map_error_code> methods.
=head1 DEFINED ERROR CODES
=over 4
=item * C<UNIQUE_CONSTRAINT>
The application issued an insert or update that would violate the uniqueness
constraint on a particular column, such as attempting to save a duplicate value
to an indexed key field.
=back
=head1 SEE ALSO
C<Data::ObjectDriver::Driver::DBD::map_error_code>
=head1 LICENSE
I<Data::ObjectDriver> is free software; you may redistribute it and/or modify
it under the same terms as Perl itself.
=head1 AUTHOR & COPYRIGHT
Except where otherwise noted, I<Data::ObjectDriver> is Copyright 2005-2006
Six Apart, cpan@sixapart.com. All rights reserved.
=cut
|