src/relpipe-tr-sql.cpp
branchv_0
changeset 56 72305cea3b71
parent 54 bc6e11cccdf4
equal deleted inserted replaced
55:3a120e64bb37 56:72305cea3b71
    79 
    79 
    80 end:
    80 end:
    81 		resultCode = CLI::EXIT_CODE_SUCCESS;
    81 		resultCode = CLI::EXIT_CODE_SUCCESS;
    82 
    82 
    83 	} catch (RelpipeCLIException& e) {
    83 	} catch (RelpipeCLIException& e) {
    84 		fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessge().c_str());
    84 		fwprintf(stderr, L"Caught CLI exception: %ls\n", e.getMessage().c_str());
    85 		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
    85 		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
    86 		resultCode = e.getExitCode();
    86 		resultCode = e.getExitCode();
    87 	} catch (SqlException& e) {
    87 	} catch (SqlException& e) {
    88 		fwprintf(stderr, L"Caught SQL exception: %ls\n", e.getMessage().c_str());
    88 		fwprintf(stderr, L"Caught SQL exception: %ls\n", e.getMessage().c_str());
    89 		for (SqlException::SqlDiagnosticsRecord dr : e.getDiagnostics()) {
    89 		for (SqlException::SqlDiagnosticsRecord dr : e.getDiagnostics()) {
    90 			fwprintf(stderr, L"\tstate: %ls, code: %d, message: %ls\n", dr.sqlState.c_str(), dr.sqlCode, dr.message.c_str());
    90 			fwprintf(stderr, L"\tstate: %ls, code: %d, message: %ls\n", dr.sqlState.c_str(), dr.sqlCode, dr.message.c_str());
    91 		}
    91 		}
    92 		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
    92 		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
    93 		resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
    93 		resultCode = CLI::EXIT_CODE_UNEXPECTED_ERROR;
    94 	} catch (RelpipeReaderException& e) {
    94 	} catch (RelpipeReaderException& e) {
    95 		fwprintf(stderr, L"Caught Reader exception: %ls\n", e.getMessge().c_str());
    95 		fwprintf(stderr, L"Caught Reader exception: %ls\n", e.getMessage().c_str());
    96 		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
    96 		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
    97 		resultCode = CLI::EXIT_CODE_DATA_ERROR;
    97 		resultCode = CLI::EXIT_CODE_DATA_ERROR;
    98 	}
    98 	}
    99 
    99 
   100 	return resultCode;
   100 	return resultCode;