19
19
namespace MQTT_NS {
20
20
21
21
struct protocol_error : std::exception {
22
- virtual char const * what () const noexcept {
22
+ char const * what () const noexcept override final {
23
23
return " protocol error" ;
24
24
}
25
25
};
26
26
27
27
struct remaining_length_error : std::exception {
28
- virtual char const * what () const noexcept {
28
+ char const * what () const noexcept override final {
29
29
return " remaining length error" ;
30
30
}
31
31
};
32
32
33
33
struct variable_length_error : std::exception {
34
- virtual char const * what () const noexcept {
34
+ char const * what () const noexcept override final {
35
35
return " variable length error" ;
36
36
}
37
37
};
38
38
39
39
struct utf8string_length_error : std::exception {
40
- virtual char const * what () const noexcept {
40
+ char const * what () const noexcept override final {
41
41
return " utf8string length error" ;
42
42
}
43
43
};
44
44
45
45
struct utf8string_contents_error : std::exception {
46
46
utf8string_contents_error (utf8string::validation r):r(r) {}
47
- virtual char const * what () const noexcept {
47
+ char const * what () const noexcept override final {
48
48
if (r == utf8string::validation::ill_formed) {
49
49
return " utf8string ill_formed" ;
50
50
}
@@ -57,13 +57,13 @@ struct utf8string_contents_error : std::exception {
57
57
};
58
58
59
59
struct will_message_length_error : std::exception {
60
- virtual char const * what () const noexcept {
60
+ char const * what () const noexcept override final {
61
61
return " will message length error" ;
62
62
}
63
63
};
64
64
65
65
struct password_length_error : std::exception {
66
- virtual char const * what () const noexcept {
66
+ char const * what () const noexcept override final {
67
67
return " password length error" ;
68
68
}
69
69
};
@@ -74,7 +74,7 @@ struct bytes_transferred_error : std::exception {
74
74
ss << " bytes transferred error. expected: " << expected << " actual: " << actual;
75
75
msg = ss.str ();
76
76
}
77
- virtual char const * what () const noexcept {
77
+ char const * what () const noexcept override final {
78
78
return msg.data ();
79
79
}
80
80
std::string msg;
@@ -95,19 +95,19 @@ struct write_bytes_transferred_error : bytes_transferred_error {
95
95
};
96
96
97
97
struct packet_id_exhausted_error : std::exception {
98
- virtual char const * what () const noexcept {
98
+ char const * what () const noexcept override final {
99
99
return " packet_id exhausted error" ;
100
100
}
101
101
};
102
102
103
103
struct property_parse_error : std::exception {
104
- virtual char const * what () const noexcept {
104
+ char const * what () const noexcept override final {
105
105
return " property parse error" ;
106
106
}
107
107
};
108
108
109
109
struct property_length_error : std::exception {
110
- virtual char const * what () const noexcept {
110
+ char const * what () const noexcept override final {
111
111
return " property length error" ;
112
112
}
113
113
};
0 commit comments