From: Sage Weil Date: Mon, 13 Jan 2014 23:50:51 +0000 (-0800) Subject: ceph-dencoder: include offset in 'stray data' error message X-Git-Tag: v0.77~20^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a5aaab3c5737cf0320f874ed36dbbe1642622dc0;p=ceph.git ceph-dencoder: include offset in 'stray data' error message Signed-off-by: Sage Weil --- diff --git a/src/test/encoding/ceph_dencoder.cc b/src/test/encoding/ceph_dencoder.cc index d18a01f156dd..bb69fddab26e 100644 --- a/src/test/encoding/ceph_dencoder.cc +++ b/src/test/encoding/ceph_dencoder.cc @@ -83,8 +83,11 @@ public: catch (buffer::error& e) { return e.what(); } - if (!stray_okay && !p.end()) - return "stray data at end of buffer"; + if (!stray_okay && !p.end()) { + ostringstream ss; + ss << "stray data at end of buffer, offset " << p.get_off(); + return ss.str(); + } return string(); } @@ -182,8 +185,11 @@ public: catch (buffer::error& e) { return e.what(); } - if (!p.end()) - return "stray data at end of buffer"; + if (!p.end()) { + ostringstream ss; + ss << "stray data at end of buffer, offset " << p.get_off(); + return ss.str(); + } return string(); }