31 std::string error_context;
32 std::string error_message;
34 if (
error->getErrorClass() == COLLADASaxFWL::IError::ERROR_SAXPARSER) {
35 error_context =
"Schema validation";
37 COLLADASaxFWL::SaxParserError *saxParserError = (COLLADASaxFWL::SaxParserError *)
error;
38 const GeneratedSaxParser::ParserError &parserError = saxParserError->getError();
39 error_message = parserError.getErrorMessage();
41 if (parserError.getErrorType() ==
42 GeneratedSaxParser::ParserError::ERROR_VALIDATION_MIN_OCCURS_UNMATCHED)
44 if (
STREQ(parserError.getElement(),
"effect")) {
49 else if (parserError.getErrorType() ==
50 GeneratedSaxParser::ParserError::
51 ERROR_VALIDATION_SEQUENCE_PREVIOUS_SIBLING_NOT_PRESENT)
53 if (!(
STREQ(parserError.getElement(),
"extra") &&
54 STREQ(parserError.getAdditionalText().c_str(),
"sibling: fx_profile_abstract")))
60 else if (parserError.getErrorType() ==
61 GeneratedSaxParser::ParserError::ERROR_COULD_NOT_OPEN_FILE)
64 error_context =
"File access";
67 else if (parserError.getErrorType() ==
68 GeneratedSaxParser::ParserError::ERROR_REQUIRED_ATTRIBUTE_MISSING)
74 isError = (parserError.getSeverity() !=
75 GeneratedSaxParser::ParserError::Severity::SEVERITY_ERROR_NONCRITICAL);
78 else if (
error->getErrorClass() == COLLADASaxFWL::IError::ERROR_SAXFWL) {
79 error_context =
"Sax FWL";
80 COLLADASaxFWL::SaxFWLError *saxFWLError = (COLLADASaxFWL::SaxFWLError *)
error;
81 error_message = saxFWLError->getErrorMessage();
88 isError = (saxFWLError->getSeverity() != COLLADASaxFWL::IError::SEVERITY_ERROR_NONCRITICAL);
91 error_context =
"OpenCollada";
92 error_message =
error->getFullErrorMessage();
96 std::string severity = (isError) ?
"Error" :
"Warning";
97 std::cout << error_context <<
" (" << severity <<
"): " << error_message << std::endl;
99 std::cout <<
"The Collada import has been forced to stop." << std::endl;
100 std::cout <<
"Please fix the reported error and then try again.";