diff --git a/CMakeLists.txt b/CMakeLists.txt index 95716bb..358541a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,14 +118,16 @@ if(NOT DEFINED USE_BOOST_VERSION) set(USE_BOOST_VERSION 1.83) endif() -find_package(Boost ${USE_BOOST_VERSION} REQUIRED COMPONENTS - system - context - chrono - json - program_options - ${BOOST_LOG_DEP} - ) +# find_package(Boost ${USE_BOOST_VERSION} REQUIRED COMPONENTS +# system +# context +# chrono +# json +# program_options +# ${BOOST_LOG_DEP} +# ) + +find_package(Boost ${USE_BOOST_VERSION} REQUIRED) if (Boost_VERSION VERSION_GREATER_EQUAL "1.85.0") find_package(Boost ${USE_BOOST_VERSION} REQUIRED COMPONENTS diff --git a/include/mysqlpool/mysqlpool.h b/include/mysqlpool/mysqlpool.h index dafe044..c9a2186 100644 --- a/include/mysqlpool/mysqlpool.h +++ b/include/mysqlpool/mysqlpool.h @@ -100,12 +100,12 @@ struct resolve_failed : public std::runtime_error { }; /*! Some error occured for a query */ -struct db_err : public std::runtime_error { +struct server_err : public std::runtime_error { - db_err(boost::system::error_code ec, std::string message) noexcept + server_err(boost::system::error_code ec, std::string message) noexcept : std::runtime_error{std::move(message)}, ec_{ec} {} - db_err(boost::system::error_code ec) noexcept + server_err(boost::system::error_code ec) noexcept : std::runtime_error{ec.message()}, ec_{ec} {} const boost::system::error_code& error() const noexcept { @@ -117,9 +117,9 @@ struct db_err : public std::runtime_error { }; /*! A query failed because a unique constraint was violated */ -struct db_err_exists : public db_err { +struct db_err_exists : public server_err { db_err_exists(boost::system::error_code ec) - : db_err(ec, ec.message()) {} + : server_err(ec, ec.message()) {} }; namespace detail { diff --git a/src/mysqlpool.cpp b/src/mysqlpool.cpp index 74a8a64..6691063 100644 --- a/src/mysqlpool.cpp +++ b/src/mysqlpool.cpp @@ -235,10 +235,10 @@ bool Mysqlpool::handleError(const boost::system::error_code &ec, boost::mysql::d return false; // retry } MYSQLPOOL_LOG_DEBUG_("The error is recoverable but we will not re-try the query."); - ::boost::throw_exception(db_err{ec}, BOOST_CURRENT_LOCATION); + ::boost::throw_exception(server_err{ec}, BOOST_CURRENT_LOCATION); default: MYSQLPOOL_LOG_DEBUG_("The error is non-recoverable"); - ::boost::throw_exception(db_err{ec}, BOOST_CURRENT_LOCATION); + ::boost::throw_exception(server_err{ec}, BOOST_CURRENT_LOCATION); } } return true;