summaryrefslogtreecommitdiff
path: root/src/xml.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/xml.cc')
-rw-r--r--src/xml.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/xml.cc b/src/xml.cc
index da4ae743..4ab6a2e7 100644
--- a/src/xml.cc
+++ b/src/xml.cc
@@ -1,6 +1,7 @@
#include <sstream>
#include <iostream>
#include <boost/lexical_cast.hpp>
+#include <boost/filesystem.hpp>
#include <libxml++/libxml++.h>
#include "xml.h"
#include "exceptions.h"
@@ -125,6 +126,10 @@ XMLNode::done ()
XMLFile::XMLFile (string file, string root_name)
{
+ if (!filesystem::exists (file)) {
+ throw FileError ("XML file does not exist", file);
+ }
+
_parser = new xmlpp::DomParser;
_parser->parse_file (file);
if (!_parser) {