49 XmlHandler handler(std::cout); |
49 XmlHandler handler(std::cout); |
50 reader->addHandler(&handler); |
50 reader->addHandler(&handler); |
51 reader->process(); |
51 reader->process(); |
52 resultCode = CLI::EXIT_CODE_SUCCESS; |
52 resultCode = CLI::EXIT_CODE_SUCCESS; |
53 } catch (RelpipeCLIException e) { |
53 } catch (RelpipeCLIException e) { |
54 fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessge().c_str()); |
54 fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessage().c_str()); |
55 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
55 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
56 resultCode = e.getExitCode(); |
56 resultCode = e.getExitCode(); |
57 } catch (RelpipeReaderException e) { |
57 } catch (RelpipeReaderException e) { |
58 fwprintf(stderr, L"Caught Reader exception: %ls\n", e.getMessge().c_str()); |
58 fwprintf(stderr, L"Caught Reader exception: %ls\n", e.getMessage().c_str()); |
59 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
59 fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount()); |
60 resultCode = CLI::EXIT_CODE_DATA_ERROR; |
60 resultCode = CLI::EXIT_CODE_DATA_ERROR; |
61 } catch (RelpipeXMLWriterException e) { |
61 } catch (RelpipeXMLWriterException e) { |
62 fwprintf(stderr, L"Error while writing XML: %ls\n", e.getMessge().c_str()); |
62 fwprintf(stderr, L"Error while writing XML: %ls\n", e.getMessage().c_str()); |
63 resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
63 resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR; |
64 } |
64 } |
65 |
65 |
66 return resultCode; |
66 return resultCode; |
67 } |
67 } |