summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-03-13 20:16:58 +0000
committerAlan Conway <aconway@apache.org>2007-03-13 20:16:58 +0000
commitd8db9228b577c28b5f8f8f0a21b3642065c10549 (patch)
tree37115711332b654e1373463628054f2124810d94
parent94ab9364be7d70c9bf862c3a447ab31bd480c387 (diff)
downloadqpid-python-d8db9228b577c28b5f8f8f0a21b3642065c10549.tar.gz
Merged revisions 496665 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid ........ r496665 | gsim | 2007-01-16 07:00:22 -0500 (Tue, 16 Jan 2007) | 3 lines Some basic additional error logging of framing errors. ........ git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@517851 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/lib/common/framing/Value.cpp5
-rw-r--r--cpp/lib/common/sys/apr/LFSessionContext.cpp12
2 files changed, 13 insertions, 4 deletions
diff --git a/cpp/lib/common/framing/Value.cpp b/cpp/lib/common/framing/Value.cpp
index fc087043e5..d193286636 100644
--- a/cpp/lib/common/framing/Value.cpp
+++ b/cpp/lib/common/framing/Value.cpp
@@ -22,6 +22,7 @@
#include <Buffer.h>
#include <FieldTable.h>
#include <QpidError.h>
+#include <sstream>
namespace qpid {
namespace framing {
@@ -85,7 +86,9 @@ std::auto_ptr<Value> Value::decode_value(Buffer& buffer)
value.reset(new FieldTableValue());
break;
default:
- THROW_QPID_ERROR(FRAMING_ERROR, "Unknown field table value type");
+ std::stringstream out;
+ out << "Unknown field table value type: " << type;
+ THROW_QPID_ERROR(FRAMING_ERROR, out.str());
}
value->decode(buffer);
return value;
diff --git a/cpp/lib/common/sys/apr/LFSessionContext.cpp b/cpp/lib/common/sys/apr/LFSessionContext.cpp
index 43fc3de3dd..ff7a0107b6 100644
--- a/cpp/lib/common/sys/apr/LFSessionContext.cpp
+++ b/cpp/lib/common/sys/apr/LFSessionContext.cpp
@@ -58,9 +58,15 @@ void LFSessionContext::read(){
in.flip();
if(initiated){
AMQFrame frame;
- while(frame.decode(in)){
- if(debug) log("RECV", &frame);
- handler->received(&frame);
+ try{
+ while(frame.decode(in)){
+ if(debug) log("RECV", &frame);
+ handler->received(&frame);
+ }
+ }catch(QpidError error){
+ std::cout << "Error [" << error.code << "] " << error.msg
+ << " (" << error.location.file << ":" << error.location.line
+ << ")" << std::endl;
}
}else{
ProtocolInitiation protocolInit;