src/relpipe-out-xml.cpp
branchv_0
changeset 13 816094aa1fff
parent 5 7c84323969d1
child 23 47a7d86ad810
--- a/src/relpipe-out-xml.cpp	Sat Jan 05 18:38:14 2019 +0100
+++ b/src/relpipe-out-xml.cpp	Sun Jan 06 22:15:38 2019 +0100
@@ -24,12 +24,14 @@
 #include <relpipe/reader/Factory.h>
 #include <relpipe/reader/RelationalReader.h>
 #include <relpipe/reader/RelpipeReaderException.h>
+#include <relpipe/xmlwriter/RelpipeXMLWriterException.h>
 
 #include "XmlHandler.h"
 
 using namespace relpipe::cli;
 using namespace relpipe::reader;
 using namespace relpipe::out::xml;
+using namespace relpipe::xmlwriter;
 
 int main(int argc, char** argv) {
 	setlocale(LC_ALL, "");
@@ -57,6 +59,9 @@
 		fwprintf(stderr, L"Caught Reader exception: %ls\n", e.getMessge().c_str());
 		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
 		resultCode = CLI::EXIT_CODE_DATA_ERROR;
+	} catch (RelpipeXMLWriterException e) {
+		fwprintf(stderr, L"Error while writing XML: %ls\n", e.getMessge().c_str());
+		resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
 	}
 
 	return resultCode;