From eef94ddeb5244237a1d75efb3f6c4e3c5664a492 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Mon, 21 Mar 2011 21:17:44 +0100
Subject: Added diagnostic error for invalid translation.


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;
+		}
 	}
 }
-- 
cgit v0.10.2-6-g49f6