[
https://issues.apache.org/jira/browse/AVRO-2153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16601247#comment-16601247
]
ASF GitHub Bot commented on AVRO-2153:
--------------------------------------
nicksbyman closed pull request #294: AVRO-2153 Clearer error msg while parsing
- specify which node had a …
URL: https://github.com/apache/avro/pull/294
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/lang/c++/impl/Compiler.cc b/lang/c++/impl/Compiler.cc
index be5fe3f86..9151ad71a 100644
--- a/lang/c++/impl/Compiler.cc
+++ b/lang/c++/impl/Compiler.cc
@@ -97,7 +97,9 @@ static NodePtr makeNode(const std::string& t, SymbolTable&
st, const string& ns)
if (it != st.end()) {
return NodePtr(new NodeSymbolic(asSingleAttribute(n), it->second));
}
- throw Exception(boost::format("Unknown type: %1%") % n.fullname());
+ std::string errorMsg = "While parsing your avro schema, we encountered a
problem making\n"
+ "a node in the json tree. The node's name is " +
n.fullname();
+ throw Exception(errorMsg);
}
const json::Object::const_iterator findField(const Entity& e,
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Generating C++ code with avrogencpp produces unclear error message
> ------------------------------------------------------------------
>
> Key: AVRO-2153
> URL: https://issues.apache.org/jira/browse/AVRO-2153
> Project: Avro
> Issue Type: Bug
> Components: c++
> Reporter: Nick Byman
> Priority: Minor
>
> If you put a bad name for a json node in an avro file, you can sometimes get:
> "Exception: boost::too_many_args: format-string referred", when avro is
> trying to tell you the name of the bad json node, because the node's name
> isn't passed to boost::format correctly.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)