src/relpipe-in-xml.cpp
branchv_0
changeset 2 3ab78bf63467
parent 0 751260846c40
child 4 1363ec0879ca
--- a/src/relpipe-in-xml.cpp	Thu Jan 10 20:05:13 2019 +0100
+++ b/src/relpipe-in-xml.cpp	Fri Jan 11 00:29:32 2019 +0100
@@ -46,10 +46,16 @@
 		XMLCommand command;
 		command.process(cin, cout);
 		resultCode = CLI::EXIT_CODE_SUCCESS;
-	} catch (RelpipeWriterException e) {
+	} catch (RelpipeWriterException& e) {
 		fwprintf(stderr, L"Caught Writer 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 (const xercesc::XMLException& e) {
+		// TODO: print message
+		// char* message = xercesc::XMLString::transcode(e.getMessage());
+		fwprintf(stderr, L"Caught xercesc::XMLException\n");
+		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
+		resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
 	}
 
 	return resultCode;