From ce33ca5732d8d980416fdfed6484bc28656e7fb8 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sat, 29 Jun 2019 14:57:39 +0530 Subject: [PATCH] better error message --- extensions/extension.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/extension.h b/extensions/extension.h index a8925e6..bab543a 100644 --- a/extensions/extension.h +++ b/extensions/extension.h @@ -11,11 +11,11 @@ struct InfoForExtension struct SentenceInfo { const InfoForExtension* infoArray; - // nullptr marks end of info array int64_t operator[](std::string propertyName) { - for (auto info = infoArray; info->name; ++info) if (propertyName == info->name) return info->value; - throw; + for (auto info = infoArray; info->name; ++info) // nullptr name marks end of info array + if (propertyName == info->name) return info->value; + return *(int*)0xcccc = 0; // gives better error message than alternatives } inline static InfoForExtension DUMMY[2] = { { "text number", 1 } };