summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 3c74993..92a0f04 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -76,7 +76,12 @@ int main(int argc, char** argv) {
iiterator end = input.end();
document_t ast;
- if (!qi::parse(begin, end, parser, ast) || begin != end) {
+ try {
+ if (!qi::parse(begin, end, parser, ast) || begin != end) {
+ cerr << "mppdown: error while parsing the file" << endl;
+ return 1;
+ }
+ } catch (...) { // VERY UGLY
cerr << "mppdown: error while parsing the file" << endl;
return 1;
}