Use ndn_getErrorString when throwing the exception
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
index 714dd1d..3454545 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
@@ -39,9 +39,9 @@
struct ndn_BinaryXMLDecoder decoder;
ndn_BinaryXMLDecoder_init(&decoder, (unsigned char *)input, inputLength);
- char *error;
+ ndn_Error error;
if (error = ndn_decodeBinaryXMLName(&nameStruct, &decoder))
- throw std::runtime_error(error);
+ throw std::runtime_error(ndn_getErrorString(error));
name.set(nameStruct);
}
@@ -55,9 +55,9 @@
struct ndn_BinaryXMLDecoder decoder;
ndn_BinaryXMLDecoder_init(&decoder, (unsigned char *)input, inputLength);
- char *error;
+ ndn_Error error;
if (error = ndn_decodeBinaryXMLInterest(&interestStruct, &decoder))
- throw std::runtime_error(error);
+ throw std::runtime_error(ndn_getErrorString(error));
interest.set(interestStruct);
}