Skip to content
Snippets Groups Projects
Unverified Commit ce5311ef authored by kongr45gpen's avatar kongr45gpen
Browse files

Fix incorrect error reporting on enums

parent 1cce9353
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@
#include <ErrorHandler.hpp>
#include <Message.hpp>
#include <Logger.hpp>
#include <type_traits>
// TODO: Find a way to reduce the number of copies of this chunk
template void ErrorHandler::logError(const Message&, ErrorHandler::AcceptanceErrorType);
......@@ -26,7 +27,7 @@ void ErrorHandler::logError(const Message& message, ErrorType errorType) {
*/
<< abi::__cxa_demangle(typeid(ErrorType).name(), nullptr, nullptr, nullptr) << " Error "
<< "[" << static_cast<uint16_t>(message.serviceType) << "," << static_cast<uint16_t>(message.messageType)
<< "]: " << errorType;
<< "]: " << std::underlying_type_t<ErrorType>(errorType);
}
template <typename ErrorType>
......@@ -36,5 +37,7 @@ void ErrorHandler::logError(ErrorType errorType) {
* Gets the error class name from the template
* Note: This is g++-dependent code and should only be used for debugging.
*/
<< abi::__cxa_demangle(typeid(ErrorType).name(), nullptr, nullptr, nullptr) << " Error: " << errorType;
<< abi::__cxa_demangle(typeid(ErrorType).name(), nullptr, nullptr, nullptr)
<< " Error: "
<< std::underlying_type_t<ErrorType>(errorType);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment