src/relpipe-in-asn1.cpp
branchv_0
changeset 2 7128fabeede0
parent 0 28294b895e5e
child 10 db8429c641c6
--- a/src/relpipe-in-asn1.cpp	Sat Jul 24 17:35:27 2021 +0200
+++ b/src/relpipe-in-asn1.cpp	Sun Jul 25 11:53:55 2021 +0200
@@ -52,10 +52,14 @@
 		std::shared_ptr<RelationalWriter> writer(Factory::create(std::cout));
 		command.process(cin, writer, configuration);
 		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 (RelpipeCLIException& e) {
+		fwprintf(stderr, L"Caught CLI 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 = e.getExitCode();
 	}
 
 	return resultCode;