Commit | Line | Data |
---|---|---|
53cd1e22 JG |
1 | /* |
2 | * Copyright (C) 2022 Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
3 | * | |
4 | * SPDX-License-Identifier: LGPL-2.1-only | |
5 | * | |
6 | */ | |
7 | ||
8 | #include "exception.hpp" | |
28ab034a | 9 | |
53cd1e22 JG |
10 | #include <common/error.hpp> |
11 | ||
28ab034a JG |
12 | #include <sstream> |
13 | ||
0038180d JG |
14 | lttng::ctl::error::error(const std::string& msg, |
15 | lttng_error_code error_code, | |
9f4d1ef3 JG |
16 | const lttng::source_location& location) : |
17 | runtime_error(msg, location), _error_code{ error_code } | |
53cd1e22 JG |
18 | { |
19 | } | |
20 | ||
baac5795 | 21 | lttng::posix_error::posix_error(const std::string& msg, |
9f4d1ef3 JG |
22 | unsigned int errno_code, |
23 | const lttng::source_location& location) : | |
a0a4f314 | 24 | std::system_error(errno_code, std::generic_category()), lttng::runtime_error(msg, location) |
53cd1e22 JG |
25 | { |
26 | } | |
aeeb48c6 | 27 | |
baac5795 | 28 | lttng::runtime_error::runtime_error(const std::string& msg, |
9f4d1ef3 JG |
29 | const lttng::source_location& location) : |
30 | std::runtime_error(msg), source_location(location) | |
aeeb48c6 JG |
31 | { |
32 | } | |
baac5795 | 33 | |
d9a970b7 | 34 | lttng::allocation_failure::allocation_failure(const std::string& msg, |
a0a4f314 JG |
35 | std::size_t allocation_size_, |
36 | const lttng::source_location& location) : | |
d9a970b7 JG |
37 | lttng::runtime_error(msg, location), allocation_size(allocation_size_) |
38 | { | |
39 | } | |
40 | ||
16d64977 JG |
41 | lttng::out_of_range::out_of_range(const std::string& msg, const lttng::source_location& location) : |
42 | lttng::runtime_error(msg, location) | |
43 | { | |
44 | } | |
45 | ||
b6bbb1d6 | 46 | lttng::unsupported_error::unsupported_error(const std::string& msg, |
9f4d1ef3 JG |
47 | const lttng::source_location& location) : |
48 | lttng::runtime_error(msg, location) | |
b6bbb1d6 JG |
49 | { |
50 | } | |
51 | ||
baac5795 | 52 | lttng::communication_error::communication_error(const std::string& msg, |
9f4d1ef3 JG |
53 | const lttng::source_location& location) : |
54 | runtime_error(msg, location) | |
baac5795 JG |
55 | { |
56 | } | |
57 | ||
58 | lttng::protocol_error::protocol_error(const std::string& msg, | |
9f4d1ef3 JG |
59 | const lttng::source_location& location) : |
60 | communication_error(msg, location) | |
baac5795 JG |
61 | { |
62 | } | |
63 | ||
64 | lttng::invalid_argument_error::invalid_argument_error(const std::string& msg, | |
9f4d1ef3 JG |
65 | const lttng::source_location& location) : |
66 | runtime_error(msg, location) | |
baac5795 JG |
67 | { |
68 | } |