From: Mikko Rasa Date: Wed, 25 Apr 2018 10:06:00 +0000 (+0300) Subject: Use nicer formatting for string keys in key_error X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ac360d8b680961af4a28601aa9c7fc47ab50caee;p=libs%2Fcore.git Use nicer formatting for string keys in key_error --- diff --git a/source/core/maputils.cpp b/source/core/maputils.cpp index 28739f0..cb2f389 100644 --- a/source/core/maputils.cpp +++ b/source/core/maputils.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "maputils.h" using namespace std; @@ -8,7 +9,10 @@ namespace Msp { string key_error::make_what(const type_info &type, const string &value) { - return format("%s(%s)", Debug::demangle(type.name()), value); + if(&type==&typeid(string)) + return format("\"%s\"", c_escape(value)); + else + return format("%s(%s)", Debug::demangle(type.name()), value); } } // namespace Msp