Don't throw if no field is found, just return normal priority.

This commit is contained in:
Vincent Richard 2005-07-24 20:22:14 +00:00
parent e14a8b6adb
commit 67eef25151

View File

@ -63,6 +63,7 @@ const importanceHelper::Importance importanceHelper::getImportance(const ref <co
const importanceHelper::Importance importanceHelper::getImportance(const ref <const header> hdr)
{
// Try "X-Priority" field
try
{
const ref <const defaultField> fld = hdr->findField("X-Priority").dynamicCast <const defaultField>();
@ -87,6 +88,9 @@ const importanceHelper::Importance importanceHelper::getImportance(const ref <co
return (i);
}
catch (exceptions::no_such_field)
{
// Try "Importance" field
try
{
const ref <const defaultField> fld = hdr->findField("Importance").dynamicCast <const defaultField>();
const string value = utility::stringUtils::toLower(utility::stringUtils::trim(fld->getValue()));
@ -98,6 +102,12 @@ const importanceHelper::Importance importanceHelper::getImportance(const ref <co
else
return (IMPORTANCE_NORMAL);
}
catch (exceptions::no_such_field)
{
// Default
return (IMPORTANCE_NORMAL);
}
}
// Should not go here...
return (IMPORTANCE_NORMAL);