| Line | |
|---|
| 1 | # =============================================================== # |
|---|
| 2 | # # |
|---|
| 3 | # File : tools.pm # |
|---|
| 4 | # Purpose : # |
|---|
| 5 | # # |
|---|
| 6 | # Coded by Ralf Westram (coder@reallysoft.de) in October 2006 # |
|---|
| 7 | # Institute of Microbiology (Technical University Munich) # |
|---|
| 8 | # http://www.arb-home.de/ # |
|---|
| 9 | # # |
|---|
| 10 | # =============================================================== # |
|---|
| 11 | |
|---|
| 12 | package tools; |
|---|
| 13 | |
|---|
| 14 | use strict; |
|---|
| 15 | use warnings; |
|---|
| 16 | |
|---|
| 17 | BEGIN { |
|---|
| 18 | use Exporter (); |
|---|
| 19 | our ($VERSION,@ISA,@EXPORT,@EXPORT_OK,%EXPORT_TAGS); |
|---|
| 20 | $VERSION = 1.00; |
|---|
| 21 | @ISA = qw(Exporter); |
|---|
| 22 | @EXPORT = qw( |
|---|
| 23 | &dieOnError |
|---|
| 24 | &expectError |
|---|
| 25 | ); |
|---|
| 26 | %EXPORT_TAGS = qw(); |
|---|
| 27 | @EXPORT_OK = qw(); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | use ARB; |
|---|
| 31 | |
|---|
| 32 | sub dieOnError($$) { |
|---|
| 33 | my ($err,$where) = @_; |
|---|
| 34 | if ($err) { die "Error at $where: $err\n"; } |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | sub expectError($) { |
|---|
| 38 | my ($where) = @_; |
|---|
| 39 | my $err = ARB::await_error(); |
|---|
| 40 | |
|---|
| 41 | dieOnError($err,$where); |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | 1; |
|---|
Note: See
TracBrowser
for help on using the repository browser.