| Tk-TM documentation | view source | Contained in the Tk-TM distribution. |
Tk::TM::Try - Tk Transaction Manager Error processing functions. See Tk::TM::Lib for main descriptions and principles.
use Tk::TM::Try;
Try sub{
TryHdr('title','stage');
TryHdr(undef,'stage1');
}
,sub{
};
Try(sub{...},0);
TryDBI $dbh
,sub{ #transaction
}
,sub{ #after rollback
};
This module implements error processing functions may be used (or not be used) in application.
use vars qw($ErrorDie $Error);
Die if error occurred. Default is false outside Try and true inside.
Last error occurred. Value is $@.
@EXPORT = qw(Try(@) TryDBI(@) TryHdr);
Try-Catch construction.
Function Try returns result of eval on success.
If error occurred (determined by $@), it returns default value or result of catch evaluation.
Try-Catch construction for database transaction.
Default database handle may be given from current data object or $Tk::TM::Common::DBH.
$dbh->{AutoCommit} and $dbh->{RaiseError} are used inside TryDBI.
Declare title and/or stage name of transaction to insert into $@ inside Try.
May be used only inside Try(sub{},...).
Created.
TO DO:
- Approve
- Debug and Test
Andrew V Makarow <makarow@mail.com>, Denis E Medvedyuk <demed@mail.com>
| Tk-TM documentation | view source | Contained in the Tk-TM distribution. |