Suppress reports on some common exception throws
This commit is contained in:
committed by
Automatic Release Builder
parent
b023c7c4f4
commit
747d99450b
@@ -75,13 +75,13 @@ BuilderException::BuilderException()
|
|||||||
}
|
}
|
||||||
|
|
||||||
BuilderException::BuilderException(const char* message, const char* origin)
|
BuilderException::BuilderException(const char* message, const char* origin)
|
||||||
: sg_exception(message, origin)
|
: sg_exception(message, origin, {}, false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
BuilderException::BuilderException(const std::string& message,
|
BuilderException::BuilderException(const std::string& message,
|
||||||
const std::string& origin)
|
const std::string& origin)
|
||||||
: sg_exception(message, origin)
|
: sg_exception(message, origin, {}, false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+35
-31
@@ -244,40 +244,43 @@ readXML (istream &input, XMLVisitor &visitor, const string &path)
|
|||||||
|
|
||||||
// FIXME: get proper error string from system
|
// FIXME: get proper error string from system
|
||||||
if (!input.good()) {
|
if (!input.good()) {
|
||||||
sg_io_exception ex ("Problem reading file",
|
sg_io_exception ex("Problem reading file",
|
||||||
sg_location(path,
|
sg_location(path,
|
||||||
XML_GetCurrentLineNumber(parser),
|
XML_GetCurrentLineNumber(parser),
|
||||||
XML_GetCurrentColumnNumber(parser)),
|
XML_GetCurrentColumnNumber(parser)),
|
||||||
"SimGear XML Parser");
|
"SimGear XML Parser",
|
||||||
visitor.setParser(0);
|
false /* don't report */);
|
||||||
XML_ParserFree(parser);
|
visitor.setParser(0);
|
||||||
throw ex;
|
XML_ParserFree(parser);
|
||||||
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
input.read(buf,16384);
|
input.read(buf,16384);
|
||||||
if (!XML_Parse(parser, buf, input.gcount(), false)) {
|
if (!XML_Parse(parser, buf, input.gcount(), false)) {
|
||||||
sg_io_exception ex (XML_ErrorString(XML_GetErrorCode(parser)),
|
sg_io_exception ex(XML_ErrorString(XML_GetErrorCode(parser)),
|
||||||
sg_location(path,
|
sg_location(path,
|
||||||
XML_GetCurrentLineNumber(parser),
|
XML_GetCurrentLineNumber(parser),
|
||||||
XML_GetCurrentColumnNumber(parser)),
|
XML_GetCurrentColumnNumber(parser)),
|
||||||
"SimGear XML Parser");
|
"SimGear XML Parser",
|
||||||
visitor.setParser(0);
|
false /* don't report */);
|
||||||
XML_ParserFree(parser);
|
visitor.setParser(0);
|
||||||
throw ex;
|
XML_ParserFree(parser);
|
||||||
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify end of document.
|
// Verify end of document.
|
||||||
if (!XML_Parse(parser, buf, 0, true)) {
|
if (!XML_Parse(parser, buf, 0, true)) {
|
||||||
sg_io_exception ex (XML_ErrorString(XML_GetErrorCode(parser)),
|
sg_io_exception ex(XML_ErrorString(XML_GetErrorCode(parser)),
|
||||||
sg_location(path,
|
sg_location(path,
|
||||||
XML_GetCurrentLineNumber(parser),
|
XML_GetCurrentLineNumber(parser),
|
||||||
XML_GetCurrentColumnNumber(parser)),
|
XML_GetCurrentColumnNumber(parser)),
|
||||||
"SimGear XML Parser");
|
"SimGear XML Parser",
|
||||||
visitor.setParser(0);
|
false /* don't report */);
|
||||||
XML_ParserFree(parser);
|
visitor.setParser(0);
|
||||||
throw ex;
|
XML_ParserFree(parser);
|
||||||
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
visitor.setParser(0);
|
visitor.setParser(0);
|
||||||
@@ -300,8 +303,8 @@ readXML (const SGPath &path, XMLVisitor &visitor)
|
|||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw sg_io_exception("Failed to open file", sg_location(path),
|
throw sg_io_exception("Failed to open file", sg_location(path),
|
||||||
"SimGear XML Parser");
|
"SimGear XML Parser", false /* don't report */);
|
||||||
}
|
}
|
||||||
input.close();
|
input.close();
|
||||||
}
|
}
|
||||||
@@ -318,11 +321,12 @@ readXML (const char *buf, const int size, XMLVisitor &visitor)
|
|||||||
visitor.startXML();
|
visitor.startXML();
|
||||||
|
|
||||||
if (!XML_Parse(parser, buf, size, false)) {
|
if (!XML_Parse(parser, buf, size, false)) {
|
||||||
sg_io_exception ex (XML_ErrorString(XML_GetErrorCode(parser)),
|
sg_io_exception ex(XML_ErrorString(XML_GetErrorCode(parser)),
|
||||||
sg_location("In-memory XML buffer",
|
sg_location("In-memory XML buffer",
|
||||||
XML_GetCurrentLineNumber(parser),
|
XML_GetCurrentLineNumber(parser),
|
||||||
XML_GetCurrentColumnNumber(parser)),
|
XML_GetCurrentColumnNumber(parser)),
|
||||||
"SimGear XML Parser");
|
"SimGear XML Parser",
|
||||||
|
false /* don't report */);
|
||||||
XML_ParserFree(parser);
|
XML_ParserFree(parser);
|
||||||
throw ex;
|
throw ex;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user