From 3338d0aaf199c069fd64d7abca7a776a04d69961 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 16 May 2006 18:51:01 +0000 Subject: [PATCH] added some error logging git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@717 9efc2488-bf62-4759-914b-345cdb29e865 --- .../OpenSRF/Transport/SlimJabber/MessageWrapper.pm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/perlmods/OpenSRF/Transport/SlimJabber/MessageWrapper.pm b/src/perlmods/OpenSRF/Transport/SlimJabber/MessageWrapper.pm index b792721..b337dff 100644 --- a/src/perlmods/OpenSRF/Transport/SlimJabber/MessageWrapper.pm +++ b/src/perlmods/OpenSRF/Transport/SlimJabber/MessageWrapper.pm @@ -1,5 +1,7 @@ package OpenSRF::Transport::SlimJabber::MessageWrapper; use XML::LibXML; +use OpenSRF::EX qw/:try/; +use OpenSRF::Utils::Logger qw/$logger/; sub new { my $class = shift; @@ -9,7 +11,17 @@ sub new { my ($doc, $msg); if ($xml) { - $doc = XML::LibXML->new->parse_string($xml); + my $err; + + try { + $doc = XML::LibXML->new->parse_string($xml); + } catch Error with { + $err = shift; + warn "MessageWrapper received bad XML : error = $err\nXML = $xml\n"; + $logger->error("MessageWrapper received bad XML : error = $err : XML = $xml"); + }; + throw $err if $err; + $msg = $doc->documentElement; } else { $doc = XML::LibXML::Document->createDocument; -- 2.11.0