forked from chizmw/catalyst-plugin-errorcatcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Error Cleanup: transaction aborted (Pg)
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
lib/Catalyst/Plugin/ErrorCatcher/Plugin/CleanUp/Pg/TransactionAborted.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package Catalyst::Plugin::ErrorCatcher::Plugin::CleanUp::Pg::TransactionAborted; | ||
use strict; | ||
use warnings; | ||
|
||
sub tidy_message { | ||
my $plugin = shift; | ||
my $errstr_ref = shift; | ||
|
||
# ERROR: current transaction is aborted, commands ignored until end of | ||
# transaction block [for Statement | ||
${$errstr_ref} =~ s{ | ||
\A | ||
.+? | ||
DBI \s Exception: | ||
.+? | ||
ERROR:\s+ | ||
( | ||
current \s transaction \s is \s aborted, \s | ||
commands \s ignored \s until \s end \s of \s transaction \s block | ||
) | ||
\s \[ for \s Statement | ||
\s+ | ||
.+ | ||
$ | ||
}{$1}xmsg; | ||
|
||
$errstr_ref; | ||
} | ||
|
||
1; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters