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