From 33ad0c196739770a012dd2855545c0f13b1daaee Mon Sep 17 00:00:00 2001 From: EricLiu2000 Date: Wed, 19 Jun 2019 11:00:41 -0400 Subject: [PATCH] C++ error descriptions now distinguish between severity levels --- api/icsneocpp/error.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/api/icsneocpp/error.cpp b/api/icsneocpp/error.cpp index acfdb46..0adb62e 100644 --- a/api/icsneocpp/error.cpp +++ b/api/icsneocpp/error.cpp @@ -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(); }