From ac360d8b680961af4a28601aa9c7fc47ab50caee Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 25 Apr 2018 13:06:00 +0300 Subject: [PATCH] Use nicer formatting for string keys in key_error --- source/core/maputils.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.43.0