Skip to content

Commit 70e4412

Browse files
committed
wallet: mark wallet error throwing functions as noreturn
Simplifies calling logic where a branch ends but a return value is needed
1 parent 1bd57c8 commit 70e4412

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wallet/wallet_errors.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ namespace tools
993993
#if !defined(_MSC_VER)
994994

995995
template<typename TException, typename... TArgs>
996-
void throw_wallet_ex(std::string&& loc, const TArgs&... args)
996+
[[noreturn]] void throw_wallet_ex(std::string&& loc, const TArgs&... args)
997997
{
998998
TException e(std::move(loc), args...);
999999
LOG_PRINT_L0(e.to_string());
@@ -1006,7 +1006,7 @@ namespace tools
10061006
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
10071007

10081008
template<typename TException>
1009-
void throw_wallet_ex(std::string&& loc)
1009+
[[noreturn]] void throw_wallet_ex(std::string&& loc)
10101010
{
10111011
TException e(std::move(loc));
10121012
LOG_PRINT_L0(e.to_string());
@@ -1015,7 +1015,7 @@ namespace tools
10151015

10161016
#define GEN_throw_wallet_ex(z, n, data) \
10171017
template<typename TException, BOOST_PP_ENUM_PARAMS(n, typename TArg)> \
1018-
void throw_wallet_ex(std::string&& loc, BOOST_PP_ENUM_BINARY_PARAMS(n, const TArg, &arg)) \
1018+
[[noreturn]] void throw_wallet_ex(std::string&& loc, BOOST_PP_ENUM_BINARY_PARAMS(n, const TArg, &arg)) \
10191019
{ \
10201020
TException e(std::move(loc), BOOST_PP_ENUM_PARAMS(n, arg)); \
10211021
LOG_PRINT_L0(e.to_string()); \

0 commit comments

Comments
 (0)