Oracle exception handling module ideas/suggestions



I'm experimenting with a Oracle-specific exception handling module. I
wonder if anyone else has done similar things, has suggestions, is
interested, etc.

Looks like this so far (using Error.pm in example, but not required of
course)

use OraErr; # default defines Oralce built-in named exceptions

try {
$sth->execute();
}
catch ORA::DUP_VAL_ON_INDEX with {
...
}
catch ORA with { # all other ora errors
my $e=shift;
printf "got ora number %d", $e->err;
};


or:

use OraErr (942, 1812); # define exceptions based on ora err nums

try {
$sth->execute();
}
catch ORA::00942 with {
...
}
catch ORA::01812 with
...
};


or:

# similar to Oracle exception_init pragma, ie, define your own
exception names
use OraErr { 942 => 'TABLE_NOT_FOUND' };

try {
$sth->execute();
}
catch ORA::TABLE_NOT_FOUND with {
...
}


Comments of any sort welcome. Thanks.

.