Closed avkhozov closed 8 years ago
I'm afraid it looks like this issue has the same problem your original post to the mailing-list had, which is that nobody understands it. I can't even say if this is meant as a bug report or feature request. Please be more specific about what exactly it is you want.
I don't know what type of this issue (bug or feature request). Rather, this is a feature request.
I want to get ability to get error code from last query in transaction. But I can't because Mojo::Transaction do rollback
when $tx
out of scope. (https://github.com/kraih/mojo-pg/blob/b43526e1612d690db1cde8155d70b558389b24f5/lib/Mojo/Pg/Transaction.pm#L8)
Sorry, but i'm afraid i can't work with the information you've provided. Perhaps you should consider making a patch and discussing it on the mailing-list or IRC.
Steps to reproduce the behavior
Issue was already described here https://groups.google.com/d/msg/mojolicious/AJIqhNAOtCo/Z6obMJLOCAAJ
If error occured in transaction,
$db->dbh
dorollback
and clear state, so$db->dbh->err
and similar return nothing.Expected behavior
I think there is any way to get errors from
dbh
related to$db->query
, but not for$db->dbh->rollback
. Like for non-blocking case, where$sth
always available, even for query with errors.Actual behavior
No information about error