Browse Source

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.
pull/145/head
Wladimir J. van der Laan 10 years ago
parent
commit
1b8fd35aad
  1. 2
      src/tinyformat.h

2
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.

Loading…
Cancel
Save