src/relpipe-tr-sql.cpp
branchv_0
changeset 35 cd9db43db120
parent 34 24c05e69d68f
child 36 91cb012d779a
--- a/src/relpipe-tr-sql.cpp	Mon May 25 19:36:06 2020 +0200
+++ b/src/relpipe-tr-sql.cpp	Mon May 25 21:11:17 2020 +0200
@@ -81,7 +81,10 @@
 		fwprintf(stderr, L"Debug: Input stream: eof=%ls, lastRead=%d\n", (cin.eof() ? L"true" : L"false"), cin.gcount());
 		resultCode = e.getExitCode();
 	} catch (SqlException& e) {
-		fwprintf(stderr, L"Caught SQL exception: %ls\n", e.getMessge().c_str());
+		fwprintf(stderr, L"Caught SQL exception: %ls\n", e.getMessage().c_str());
+		for (SqlException::SqlDiagnosticsRecord dr : e.getDiagnostics()) {
+			fwprintf(stderr, L"\tstate: %ls, code: %d, message: %ls\n", dr.sqlState.c_str(), dr.sqlCode, dr.message.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_UNEXPECTED_ERROR;
 	} catch (RelpipeReaderException& e) {