fixing Set on report properties

Setting valid value for property which is incorrect for current
configuration will result in OK response, but will change ErrorMessages
property. ErrorMessages will contain information about error type and
property name.

Tested:
- Change interval from 1000 to 0 for periodic report changes status from
  Enabled to Disabled.
- Change interval from 0 to 1000 for periodic report changes status from
  Disabled to Enabled.

Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: I34add1ed0308b3da0850b1db6a67a217d11b6956
diff --git a/src/types/error_type.hpp b/src/types/error_type.hpp
new file mode 100644
index 0000000..0f1d61e
--- /dev/null
+++ b/src/types/error_type.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "utils/conversion.hpp"
+
+#include <sdbusplus/exception.hpp>
+
+#include <array>
+#include <cstdint>
+#include <string_view>
+#include <type_traits>
+
+enum class ErrorType : uint32_t
+{
+    propertyConflict
+};
+
+namespace utils
+{
+
+constexpr auto convDataErrorType =
+    std::array{std::make_pair<std::string_view, ErrorType>(
+        "PropertyConflict", ErrorType::propertyConflict)};
+
+inline ErrorType toErrorType(std::underlying_type_t<ErrorType> value)
+{
+    return toEnum<ErrorType, minEnumValue(convDataErrorType),
+                  maxEnumValue(convDataErrorType)>(value);
+}
+
+inline ErrorType toErrorType(const std::string& value)
+{
+    return toEnum(convDataErrorType, value);
+}
+
+inline std::string enumToString(ErrorType value)
+{
+    return std::string(enumToString(convDataErrorType, value));
+}
+
+} // namespace utils