Use ndn_getErrorString when throwing the exception
diff --git a/ndn-cpp/encoding/BinaryXMLStructureDecoder.hpp b/ndn-cpp/encoding/BinaryXMLStructureDecoder.hpp
index eac9a8d..ad562ff 100644
--- a/ndn-cpp/encoding/BinaryXMLStructureDecoder.hpp
+++ b/ndn-cpp/encoding/BinaryXMLStructureDecoder.hpp
@@ -31,9 +31,9 @@
    */
   bool findElementEnd(unsigned char *input, unsigned int inputLength) 
   {
-    char *error;
+    ndn_Error error;
     if (error = ndn_BinaryXMLStructureDecoder_findElementEnd(&base_, input, inputLength))
-      throw std::runtime_error(error);
+      throw std::runtime_error(ndn_getErrorString(error));
     return gotElementEnd();
   }