NAME
DBIO::Exception - Exception objects for DBIO
VERSION
version 0.900004
DESCRIPTION
Exception objects of this class are used internally by the default error handling of "throw_exception" in DBIO::Schema and derivatives.
These objects stringify to the contained error message, and use overload fallback to give natural boolean/numeric values.
METHODS
throw
This is meant for internal use by DBIO's throw_exception code, and shouldn't be used directly elsewhere.
Expects a scalar exception message. The optional boolean $stacktrace causes it to output a full trace similar to confess. Unlike confess, the trace does not quote the password of a connection among the arguments of its frames: it is shown as ***, see "stacktrace" in DBIO::Schema. The optional \@connect_info is a connect info in the DBI form [ $dsn, $user, $password, \%attrs ] that the trace masks as well; it is only read, nothing is asked for it.
DBIO::Exception->throw('Foo');
try { ... } catch { DBIO::Exception->throw(shift) }
rethrow
This method provides some syntactic sugar in order to re-throw exceptions.
Error texts carry no bind values
The text of an exception about a statement names the statement and the number of its bind values, [for Statement "..." with N bind values], and never a value. ShowErrorStatement of the database handle is off, also when connect_info sets it. What the caller writes as a literal into the SQL itself is part of the statement text; the text the server writes about the error ("detail" in DBIO::Exception::Server) is the business of the driver. An exception belongs in a log; to a client goes a message of the application's own, not the exception.
AUTHOR
DBIO & DBIx::Class Authors
COPYRIGHT AND LICENSE
Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.