# HG changeset patch # User František Kučera # Date 1618736008 -7200 # Node ID 0d858e0eedf89ae3527529688251c560f4f8a11e # Parent 4ed57cf3dcd1d8ebb64cb5965c5f7807b4480f43 handle RelpipeCLIException diff -r 4ed57cf3dcd1 -r 0d858e0eedf8 src/relpipe-in-csv.cpp --- a/src/relpipe-in-csv.cpp Sat Oct 24 00:08:17 2020 +0200 +++ b/src/relpipe-in-csv.cpp Sun Apr 18 10:53:28 2021 +0200 @@ -52,6 +52,10 @@ std::shared_ptr writer(Factory::create(std::cout)); command.process(cin, writer, configuration); resultCode = CLI::EXIT_CODE_SUCCESS; + } 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(); } 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());