summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/Base/format.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Swiften/Base/format.h b/Swiften/Base/format.h
index 9e242ff..4591827 100644
--- a/Swiften/Base/format.h
+++ b/Swiften/Base/format.h
@@ -11,8 +11,14 @@
namespace Swift {
inline boost::format format(const std::string& s) {
using namespace boost::io;
- boost::format fmter(s);
- fmter.exceptions( all_error_bits ^ ( too_many_args_bit | too_few_args_bit ) );
- return fmter;
+ try {
+ boost::format fmter(s);
+ fmter.exceptions(no_error_bits);
+ return fmter;
+ }
+ catch (...) {
+ std::cerr << "Error: Invalid translation: " << s << std::endl;
+ throw;
+ }
}
}