From: tho Date: Wed, 3 Aug 2011 14:03:04 +0000 (+0000) Subject: Packets/80221Bundle: enhanced error message in MIHBaseTLVParser::validateType() X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=0003d55730b447329342161d12cf2ed23b63459e;p=senf.git Packets/80221Bundle: enhanced error message in MIHBaseTLVParser::validateType() git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1805 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Packets/80221Bundle/TLVParser.cc b/senf/Packets/80221Bundle/TLVParser.cc index ddc3340..d677de8 100644 --- a/senf/Packets/80221Bundle/TLVParser.cc +++ b/senf/Packets/80221Bundle/TLVParser.cc @@ -51,7 +51,9 @@ prefix_ void senf::MIHBaseTLVParser::validateType(boost::uint8_t expectedType) const { if (! check( 1 + senf::bytes(length_()) + length()) ) - throw InvalidMIHPacketException("truncated TLV.") << " Type: " << unsigned(type()); + throw InvalidMIHPacketException("truncated TLV.") << " Type: " << unsigned(type()) + << ", size:" << 1 + senf::bytes(length_()) + length() + << ", available: " << std::distance(i(), data().end()); if (type() != expectedType) throw InvalidMIHPacketException("wrong TLV type. expected ") << unsigned(expectedType) << " got " << unsigned(type()); }