From 7c22792bdfa1f89990736bd8ef67cb4e5e64220f Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 22 Dec 2015 16:32:25 -0800 Subject: [tests] Rewrite resource loading test Make it more readable and easier to debug. --- include/mbgl/util/string.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/mbgl/util/string.hpp') diff --git a/include/mbgl/util/string.hpp b/include/mbgl/util/string.hpp index 9e2b2d8819..bc6b3b1eff 100644 --- a/include/mbgl/util/string.hpp +++ b/include/mbgl/util/string.hpp @@ -22,6 +22,15 @@ inline std::string toString(int8_t num) { return boost::lexical_cast(int(num)); } +inline std::string toString(std::exception_ptr error) { + try { + std::rethrow_exception(error); + } catch (const std::exception& ex) { + return ex.what(); + } catch (...) { + return "Unknown exception type"; + } +} template inline std::string sprintf(const char *msg, Args... args) { -- cgit v1.2.1