From 93cfbf8dd218c7a3bf8ea7c9f32c09330df52c0b Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 9 May 2011 01:05:21 -0400 Subject: [PATCH] Error Messages - Improved error messages with specific field names rather than types. --- src/columns/ColDate.cpp | 2 +- src/columns/ColDepends.cpp | 2 +- src/columns/ColDescription.cpp | 2 +- src/columns/ColID.cpp | 2 +- src/columns/ColPriority.cpp | 2 +- src/columns/ColProject.cpp | 2 +- src/columns/ColRecur.cpp | 2 +- src/columns/ColStatus.cpp | 2 +- src/columns/ColString.cpp | 2 +- src/columns/ColTags.cpp | 2 +- src/columns/ColUUID.cpp | 2 +- src/columns/ColUrgency.cpp | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/columns/ColDate.cpp b/src/columns/ColDate.cpp index 791dc014a..3ad6ecccb 100644 --- a/src/columns/ColDate.cpp +++ b/src/columns/ColDate.cpp @@ -93,7 +93,7 @@ void ColumnDate::measure (Task& task, int& minimum, int& maximum) minimum = maximum = Duration (now - date).formatCompact ().length (); } else - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format '") + _attribute + "." + _style + "'"; } } diff --git a/src/columns/ColDepends.cpp b/src/columns/ColDepends.cpp index af6a51c92..798624953 100644 --- a/src/columns/ColDepends.cpp +++ b/src/columns/ColDepends.cpp @@ -91,7 +91,7 @@ void ColumnDepends::measure (Task& task, int& minimum, int& maximum) } } else - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'depends.") + _style + "'"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColDescription.cpp b/src/columns/ColDescription.cpp index 55cdc2d83..b132a73d0 100644 --- a/src/columns/ColDescription.cpp +++ b/src/columns/ColDescription.cpp @@ -125,7 +125,7 @@ void ColumnDescription::measure (Task& task, int& minimum, int& maximum) } else - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'description.") + _style + "'"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColID.cpp b/src/columns/ColID.cpp index 9c2284f14..10fdb8c3a 100644 --- a/src/columns/ColID.cpp +++ b/src/columns/ColID.cpp @@ -60,7 +60,7 @@ void ColumnID::measure (Task& task, int& minimum, int& maximum) minimum = maximum = length; if (_style != "default") - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'id.") + _style + "'"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColPriority.cpp b/src/columns/ColPriority.cpp index c8dd8d9dc..9fa9d2ce4 100644 --- a/src/columns/ColPriority.cpp +++ b/src/columns/ColPriority.cpp @@ -69,7 +69,7 @@ void ColumnPriority::measure (Task& task, int& minimum, int& maximum) else if (priority == "L") minimum = maximum = 3; } else if (_style != "default") - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'priority.") + _style + "'"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColProject.cpp b/src/columns/ColProject.cpp index 67896175a..dac577181 100644 --- a/src/columns/ColProject.cpp +++ b/src/columns/ColProject.cpp @@ -58,7 +58,7 @@ void ColumnProject::measure (Task& task, int& minimum, int& maximum) project = project.substr (0, period); } else if (_style != "default") - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'project.") + _style + "'"; minimum = longestWord (project); maximum = project.length (); diff --git a/src/columns/ColRecur.cpp b/src/columns/ColRecur.cpp index 5e9e0c2a1..643045b52 100644 --- a/src/columns/ColRecur.cpp +++ b/src/columns/ColRecur.cpp @@ -70,7 +70,7 @@ void ColumnRecur::measure (Task& task, int& minimum, int& maximum) minimum = maximum = context.config.get ("recurrence.indicator").length (); } else - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'recur.") + _style + "'"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColStatus.cpp b/src/columns/ColStatus.cpp index b6193e12a..ccf26ffe0 100644 --- a/src/columns/ColStatus.cpp +++ b/src/columns/ColStatus.cpp @@ -78,7 +78,7 @@ void ColumnStatus::measure (Task& task, int& minimum, int& maximum) else if (_style == "short") minimum = maximum = 1; else - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'status.") + _style + "'"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColString.cpp b/src/columns/ColString.cpp index 57ea9f28f..38e9bb286 100644 --- a/src/columns/ColString.cpp +++ b/src/columns/ColString.cpp @@ -67,7 +67,7 @@ void ColumnString::measure (const std::string& value, int& minimum, int& maximum minimum = longestWord (value); } else - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'string.") + _style + "'"; } diff --git a/src/columns/ColTags.cpp b/src/columns/ColTags.cpp index 56e1face0..6233711f3 100644 --- a/src/columns/ColTags.cpp +++ b/src/columns/ColTags.cpp @@ -81,7 +81,7 @@ void ColumnTags::measure (Task& task, int& minimum, int& maximum) } } else - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'tags.") + _style + "'"; } diff --git a/src/columns/ColUUID.cpp b/src/columns/ColUUID.cpp index 5ded9e817..08bc3f5c2 100644 --- a/src/columns/ColUUID.cpp +++ b/src/columns/ColUUID.cpp @@ -52,7 +52,7 @@ void ColumnUUID::measure (Task& task, int& minimum, int& maximum) if (_style == "default") minimum = maximum = 36; else if (_style == "short") minimum = maximum = 8; else - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'uuid.") + _style + "'"; } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColUrgency.cpp b/src/columns/ColUrgency.cpp index 71dd921b3..73fef70ca 100644 --- a/src/columns/ColUrgency.cpp +++ b/src/columns/ColUrgency.cpp @@ -51,7 +51,7 @@ void ColumnUrgency::measure (Task& task, int& minimum, int& maximum) minimum = maximum = format (task.urgency (), 4, 3).length (); if (_style != "default") - throw std::string ("Unrecognized column format '") + _type + "." + _style + "'"; + throw std::string ("Unrecognized column format 'urgency.") + _style + "'"; } ////////////////////////////////////////////////////////////////////////////////