From 0e2d3643de427862f2f95938f70e3a6c5b1442d5 Mon Sep 17 00:00:00 2001 From: Adam Radziszewski <adam.radziszewski@pwr.wroc.pl> Date: Wed, 1 Jun 2011 10:04:39 +0200 Subject: [PATCH] clearer lexicon error messages --- libwccl/lexicon/lexicon.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libwccl/lexicon/lexicon.cpp b/libwccl/lexicon/lexicon.cpp index 3dd0f38..74d1341 100644 --- a/libwccl/lexicon/lexicon.cpp +++ b/libwccl/lexicon/lexicon.cpp @@ -33,13 +33,13 @@ boost::shared_ptr<StrSet> Lexicon::translate(const StrSet& set) const void Lexicon::insert(const UnicodeString& key, const UnicodeString& value) { if (has_key(key)) { - throw InvalidArgument("key", PwrNlp::to_utf8(key) + " - entry already added."); + throw InvalidArgument("key", "Duplicated key in lexicon: " + PwrNlp::to_utf8(key)); } if (key.isEmpty()) { - throw InvalidArgument("key", "Cannot add an empty string."); + throw InvalidArgument("key", "Empty key string in lexicon."); } if (value.isEmpty()) { - throw InvalidArgument("value", "Cannot add an empty string."); + throw InvalidArgument("value", "Empty value string in lexicon."); } map_[key] = value; } -- GitLab