diff --git a/odcread.cc b/odcread.cc
index 24bb51ea68a0fa9e8706ac8a42aa11b94871c6fb..858028e6babf5e252ede8ade0c0f71d2946ceb4e 100644 (file)
--- a/odcread.cc
+++ b/odcread.cc
d_context.top()->addPiece(text);
}
virtual void textLongPiece(const LongPiece *piece) {
- std::string text = piece->getText();
- d_context.top()->addPiece(text);
+ throw "Long Piece not handled";
+ //std::string text = piece->getText();
+ //d_context.top()->addPiece(text);
}
};
return 1;
}
std::ifstream in(argv[1], std::ios::in | std::ios::binary);
- odc::Store* s = odc::importDocument(in);
+
+ odc::Store* s;
+ try {
+ s = odc::importDocument(in);
+ } catch (int trap) {
+ std::cerr << "Exception in parsing file: BlackBox trap no. " << trap << std::endl;
+ return 2;
+ } catch (const char * exception) {
+ std::cerr << "Exception in parsing file: " << exception << std::endl;
+ return 2;
+ }
// std::cout << s->toPlainText() << std::endl;
// std::cout << std::endl << std::endl;
- odc::MyVisitor visitor;
- s->accept(visitor);
+ try {
+ odc::MyVisitor visitor;
+ s->accept(visitor);
+ } catch (const char * exception) {
+ std::cerr << "Exception in processing document: " << exception << std::endl;
+ return 3;
+ }
// std::cout << s->toString() << std::endl;
// std::cout << in.tellg() << " " << in.eof() << std::endl;