C++ error descriptions now distinguish between severity levels

checksum-failure-logging
EricLiu2000 2019-06-19 11:00:41 -04:00
parent 12cb4c227a
commit 33ad0c1967
1 changed files with 13 additions and 1 deletions

View File

@ -30,7 +30,19 @@ std::string APIError::describe() const noexcept {
ss << *device; // Makes use of device.describe()
else
ss << "API";
ss << " Error: ";
Severity severity = getSeverity();
if(severity == Severity::Info) {
ss << " Info: ";
} else if(severity == Severity::Warning) {
ss << " Warning: ";
} else if(severity == Severity::Error) {
ss << " Error: ";
} else {
// Should never get here, since Severity::Any should only be used for filtering
ss << " Any: ";
}
ss << getDescription();
return ss.str();
}