|
1 | | -// Copyright 2019-2019 the nyan authors, LGPLv3+. See copying.md for legal info. |
| 1 | +// Copyright 2019-2021 the nyan authors, LGPLv3+. See copying.md for legal info. |
2 | 2 |
|
3 | 3 | #include "api_error.h" |
4 | 4 |
|
|
7 | 7 |
|
8 | 8 | namespace nyan { |
9 | 9 |
|
10 | | -APIError::APIError(const std::string &msg) |
11 | | - : |
| 10 | +APIError::APIError(const std::string &msg) : |
12 | 11 | Error{msg} {} |
13 | 12 |
|
14 | 13 |
|
15 | | -InvalidObjectError::InvalidObjectError() |
16 | | - : |
| 14 | +InvalidObjectError::InvalidObjectError() : |
17 | 15 | APIError("uninitialized object was used") {} |
18 | 16 |
|
19 | 17 |
|
20 | | -MemberTypeError::MemberTypeError(const fqon_t &objname, const memberid_t &member, |
21 | | - const std::string &real_type, const std::string &wrong_type) |
22 | | - : |
23 | | - APIError{ |
24 | | - (static_cast<const std::ostringstream&>( |
25 | | - std::ostringstream{} << "type mismatch for member " << objname + "." << member |
26 | | - << ": tried to convert real type " << real_type << " to " << wrong_type) |
27 | | - ).str()}, |
28 | | - name{objname}, |
| 18 | +MemberTypeError::MemberTypeError(const fqon_t &objname, |
| 19 | + const memberid_t &member, |
| 20 | + const std::string &real_type, |
| 21 | + const std::string &wrong_type) : |
| 22 | + APIError{(static_cast<const std::ostringstream &>( |
| 23 | + std::ostringstream{} << "type mismatch for member " << objname + "." << member |
| 24 | + << ": tried to convert real type " << real_type << " to " << wrong_type)) |
| 25 | + .str()}, |
| 26 | + objname{objname}, |
29 | 27 | member{member}, |
30 | 28 | real_type{real_type}, |
31 | 29 | wrong_type{wrong_type} {} |
32 | 30 |
|
33 | 31 |
|
34 | | -ObjectNotFoundError::ObjectNotFoundError(const fqon_t &obj_name) |
35 | | - : |
| 32 | +ObjectNotFoundError::ObjectNotFoundError(const fqon_t &obj_name) : |
36 | 33 | APIError{"object not found: " + obj_name}, |
37 | | - name{obj_name} {} |
| 34 | + objname{obj_name} {} |
38 | 35 |
|
39 | 36 |
|
40 | 37 | MemberNotFoundError::MemberNotFoundError(const fqon_t &obj_name, |
41 | | - const memberid_t &member_name) |
42 | | - : |
| 38 | + const memberid_t &member_name) : |
43 | 39 | APIError{"Could not find member " + obj_name + "." + member_name}, |
44 | | - obj_name{obj_name}, |
| 40 | + objname{obj_name}, |
45 | 41 | name{member_name} {} |
46 | 42 |
|
47 | 43 | } // namespace nyan |
0 commit comments