summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-03-21 20:17:44 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-03-21 20:17:44 (GMT)
commiteef94ddeb5244237a1d75efb3f6c4e3c5664a492 (patch)
tree9c83cbab1679a827fcc8a21c2ba9fde5ebc4a9c9
parent41ecc60e682a745e55ab2a2ebb9770c953452ce5 (diff)
downloadswift-eef94ddeb5244237a1d75efb3f6c4e3c5664a492.zip
swift-eef94ddeb5244237a1d75efb3f6c4e3c5664a492.tar.bz2
Added diagnostic error for invalid translation.
-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;
+ }
}
}