Skip to content
Snippets Groups Projects
Commit 884c3547 authored by athatheo's avatar athatheo
Browse files

Merge branch 'fix-incorrect-error-reporting' into 'master'

Fix incorrect error reporting on enums

Closes #173

See merge request acubesat/obc/ecss-services!111
parents f21e149d ce5311ef
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