We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http://pqxx.org/development/libpqxx/wiki/WikiStart#Handlingerrors
#include <iostream> #include <pqxx/except> #include "my-db-code.hxx" int main(int argc, char *argv[]) { try { do_db_work(trans); } catch (const std::exception &e) { std::cerr << e.what() << std::endl; return 1; } catch (const pqxx::sql_error &e) { std::cerr << "Database error: " << e.what() << std::endl << "Query was: " << e.query() << std::endl; return 2; } }
The second catch of pqxx::sql_error will never execute https://ideone.com/Nsf3SM It must be moved before std::exception catch https://ideone.com/JCUWu8
pqxx::sql_error
std::exception
The text was updated successfully, but these errors were encountered:
Whoops! You're right, of course. I've made the change.
Sorry, something went wrong.
No branches or pull requests
http://pqxx.org/development/libpqxx/wiki/WikiStart#Handlingerrors
The second catch of
pqxx::sql_error
will never execute https://ideone.com/Nsf3SMIt must be moved before
std::exception
catch https://ideone.com/JCUWu8The text was updated successfully, but these errors were encountered: