OK - I have found a solution that works so far.

Using this sub:
#------------------------------------------------------------------------#
# Handle errors from DbXMl etc.
sub _handle_err {

if (ref($@)) {
if (UNIVERSAL::isa($@,'Error')) {
[EMAIL PROTECTED]>throw;
}
elsif (UNIVERSAL::isa($@,'XmlException')) {
Apache::AxKit::Exception->new(-text=>[EMAIL PROTECTED]>what())->throw;
}
elsif (UNIVERSAL::isa($@,'std::exception')) {
Apache::AxKit::Exception->new(-text=>[EMAIL PROTECTED]>what())->throw;
}
else {
Apache::AxKit::Exception->new(-text=>'Unknown Exception :'.ref($@))->throw;
}
}
else {
Apache::AxKit::Exception->new(-text=>'$@')->throw;
}
};
#------------------------------------------------------------------------#



Then - in any sub in my module that is using DbXML (with eval) if I include:

local $SIG{__DIE__} = \&_handle_err;

then the errors are cast to AxKit Exceptions and all works tidily.


Mind you - this is only tested for opening the container and using getDocument!



Mike



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10/05/2005


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to