DBIx::ParseError::MySQL - Error parser for MySQL
version v1.0.3
use DBIx::ParseError::MySQL; eval { my $result = $dbh->do('SELECT 1'); }; if ($@) { if (DBIx::ParseError::MySQL->new($@)->is_transient) { $dbh->reconnect } else { die; } }
This module is a database error categorizer, specifically for MySQL. This module is also compatible with Galera's WSREP errors.
Returns the original, untouched error object or string.
Returns the stringified version of the error.
Returns a string that describes the type of error. These can be one of the following:
lock Lock errors, like a lock wait timeout or deadlock connection Connection/packet failures, disconnections shutdown Errors that happen when a server is shutting down duplicate_value Duplicate entry errors unknown Any other error
Returns a true value if the error is the type that is likely transient. For example, errors that recommend retrying transactions or connection failures. This check can be used to figure out if it's worth retrying a transaction.
This is merely a check for the following error types: lock connection shutdown.
lock connection shutdown
my $parsed_error = DBIx::ParseError::MySQL->new($@);
Returns a DBIx::ParseError::MySQL object. Since the error is the only parameter, it can be passed by itself.
DBIx::ParseError::MySQL
DBIx::Class::ParseError - A similar parser, but specifically tailored to DBIx::Class.
Grant Street Group <developers@grantstreet.com>
This software is Copyright (c) 2020 - 2023 by Grant Street Group.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install DBIx::ParseError::MySQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::ParseError::MySQL
CPAN shell
perl -MCPAN -e shell install DBIx::ParseError::MySQL
For more information on module installation, please visit the detailed CPAN module installation guide.