diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-02-28 09:25:00 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-02-28 09:25:00 +0100 |
commit | 1b8fd35aadfad6a1e55391f02add6076c8c9ea8f (patch) | |
tree | ec1a51330250ca42add7de3c94384b4f9b64d40c /src/tinyformat.h | |
parent | afe2a203edcd98d668c80e6d688bcaffb9fccde0 (diff) |
Make tinyformat errors raise an exception instead of assert()ing
By default tinyformat errors such as 'wrong number of conversion
specifiers in format string' cause an assertion failure.
Raise an exception instead so that error handling can recover or can
show an appropriate error.
Diffstat (limited to 'src/tinyformat.h')
-rw-r--r-- | src/tinyformat.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tinyformat.h b/src/tinyformat.h index 04b51f0adc..b6113029f5 100644 --- a/src/tinyformat.h +++ b/src/tinyformat.h @@ -109,7 +109,7 @@ namespace tinyformat {} namespace tfm = tinyformat; // Error handling; calls assert() by default. -// #define TINYFORMAT_ERROR(reasonString) your_error_handler(reasonString) +#define TINYFORMAT_ERROR(reasonString) throw std::runtime_error(reasonString) // Define for C++11 variadic templates which make the code shorter & more // general. If you don't define this, C++11 support is autodetected below. |