forked from JS8Call-improved/JS8Call-improved
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessageError.cpp
More file actions
47 lines (39 loc) · 1.17 KB
/
MessageError.cpp
File metadata and controls
47 lines (39 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "MessageError.hpp"
/******************************************************************************/
// 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;
}
/******************************************************************************/
// Implementation
/******************************************************************************/
namespace MessageError
{
std::error_category const &
category() noexcept
{
return Category;
}
}
/******************************************************************************/