src/relpipe-out-csv.cpp
branchv_0
changeset 1 82f86dc48339
parent 0 97967db4b95b
child 2 75aeeb022302
equal deleted inserted replaced
0:97967db4b95b 1:82f86dc48339
    25 #include <relpipe/reader/Factory.h>
    25 #include <relpipe/reader/Factory.h>
    26 #include <relpipe/reader/RelationalReader.h>
    26 #include <relpipe/reader/RelationalReader.h>
    27 #include <relpipe/reader/RelpipeReaderException.h>
    27 #include <relpipe/reader/RelpipeReaderException.h>
    28 
    28 
    29 #include "CSVHandler.h"
    29 #include "CSVHandler.h"
       
    30 #include "RelpipeCSVWriterException.h"
    30 
    31 
    31 using namespace relpipe::cli;
    32 using namespace relpipe::cli;
    32 using namespace relpipe::reader;
    33 using namespace relpipe::reader;
    33 using namespace relpipe::out::csv;
    34 using namespace relpipe::out::csv;
    34 
    35 
    51 		resultCode = e.getExitCode();
    52 		resultCode = e.getExitCode();
    52 	} catch (RelpipeReaderException e) {
    53 	} catch (RelpipeReaderException e) {
    53 		fwprintf(stderr, L"Caught Reader exception: %ls\n", e.getMessge().c_str());
    54 		fwprintf(stderr, L"Caught Reader exception: %ls\n", e.getMessge().c_str());
    54 		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());
    55 		resultCode = CLI::EXIT_CODE_DATA_ERROR;
    56 		resultCode = CLI::EXIT_CODE_DATA_ERROR;
       
    57 	} catch (RelpipeCSVWriterException e) {
       
    58 		fwprintf(stderr, L"Error while generating CSV: %ls\n", e.getMessge().c_str());
       
    59 		resultCode = CLI::EXIT_CODE_DATA_ERROR;
    56 	}
    60 	}
    57 
    61 
    58 	return resultCode;
    62 	return resultCode;
    59 }
    63 }