js8call/JS8_Main/MessageError.cpp
Chris-AC9KH 356bdc0f50 Code cleanup - move loose source and header files in source tree to group folders
Rename all header files with .h extension
Fix function declaration in HamlibTransceiver.h that overrode member function but was not marked override
Remove unused variable in Modulator.cpp
Remove unused files from source tree
Remove duplicate LazyFillComboBox files
Reformat codebase to LLVM C++ standard
2026-01-02 16:46:38 -06:00

35 lines
1.1 KiB
C++

#include "MessageError.h"
/******************************************************************************/
// Private Implementation
/******************************************************************************/
namespace {
const struct final : public std::error_category {
const char *name() const noexcept override { return "message"; }
std::string message(int const ev) const override {
using MessageError::Code;
switch (static_cast<Code>(ev)) {
case Code::json_parsing_error:
return "json parsing error";
case Code::json_not_an_object:
return "json not an object";
default:
return "message error";
}
}
} Category;
} // namespace
/******************************************************************************/
// Implementation
/******************************************************************************/
namespace MessageError {
std::error_category const &category() noexcept { return Category; }
} // namespace MessageError
/******************************************************************************/