diff -r 68a281aefa76 -r 7128fabeede0 src/relpipe-in-asn1.cpp --- 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 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;