mirror of
https://github.com/jezhiggins/arabica
synced 2025-01-17 18:12:04 +01:00
better error handling when loading docs
This commit is contained in:
parent
4ab8d34349
commit
53184edc79
1 changed files with 3 additions and 1 deletions
|
@ -53,11 +53,13 @@ protected:
|
||||||
|
|
||||||
Arabica::SAX::InputSource<string_type, string_adaptor> is(SA::construct_from_utf8(filename.c_str()));
|
Arabica::SAX::InputSource<string_type, string_adaptor> is(SA::construct_from_utf8(filename.c_str()));
|
||||||
Arabica::SAX2DOM::Parser<string_type, string_adaptor> parser;
|
Arabica::SAX2DOM::Parser<string_type, string_adaptor> parser;
|
||||||
|
Arabica::SAX::CatchErrorHandler<std::string> eh;
|
||||||
|
parser.setErrorHandler(eh);
|
||||||
parser.parse(is);
|
parser.parse(is);
|
||||||
|
|
||||||
Document d = parser.getDocument();
|
Document d = parser.getDocument();
|
||||||
if(d == 0)
|
if(d == 0)
|
||||||
assertImplementation(false, "Could not load", -1, filename);
|
assertImplementation(false, "Could not load : " + eh.errors(), -1, filename);
|
||||||
|
|
||||||
//d.normalize();
|
//d.normalize();
|
||||||
return d;
|
return d;
|
||||||
|
|
Loading…
Reference in a new issue