Exception Handling, Logging, and Parameter Validation 20

Exception::Class

use Exception::Class
    ( 'SQLException' =>
      { fields => [ 'sql', 'bound_values' ],
        alias  => 'sql_error' }
    );

sql_error error => 'bad sql', sql => $sql;