File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -239,14 +239,21 @@ int main(int argc, char** argv)
239239 }
240240 catch (odbc_soci_error & e)
241241 {
242- if (string (reinterpret_cast <char const *>(e.odbc_error_code ())) == " 28000" && e. native_error_code () == 18456 )
242+ if (string (reinterpret_cast <char const *>(e.odbc_error_code ())) == " 28000" )
243243 {
244- write_error (" The login credentials may be incorrect." );
245- }
246- else
247- {
248- write_error (" DB error: " s + e.what ());
244+ if (e.native_error_code () == 18452 )
245+ {
246+ write_error (" You attempted to connect with a trusted connection, but the current user is not trusted. Try a username and password." );
247+ return 2 ;
248+ }
249+ if (e.native_error_code () == 18456 )
250+ {
251+ write_error (" The login credentials may be incorrect." );
252+ return 2 ;
253+ }
249254 }
255+
256+ write_error (" DB error: " s + e.what ());
250257 return 1 ;
251258 }
252259 catch (soci_error& e)
@@ -262,6 +269,6 @@ int main(int argc, char** argv)
262269 catch (...)
263270 {
264271 write_error (" Something went wrong." );
265- return 2 ;
272+ return 3 ;
266273 }
267274}
You can’t perform that action at this time.
0 commit comments