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) : | |
24 | std::system_error(errno_code, std::generic_category()), | |
25 | lttng::runtime_error(msg, location) | |
53cd1e22 JG |
26 | { |
27 | } | |
aeeb48c6 | 28 | |
baac5795 | 29 | lttng::runtime_error::runtime_error(const std::string& msg, |
9f4d1ef3 JG |
30 | const lttng::source_location& location) : |
31 | std::runtime_error(msg), source_location(location) | |
aeeb48c6 JG |
32 | { |
33 | } | |
baac5795 | 34 | |
d9a970b7 JG |
35 | lttng::allocation_failure::allocation_failure(const std::string& msg, |
36 | std::size_t allocation_size_, | |
37 | const lttng::source_location& location) : | |
38 | lttng::runtime_error(msg, location), allocation_size(allocation_size_) | |
39 | { | |
40 | } | |
41 | ||
b6bbb1d6 | 42 | lttng::unsupported_error::unsupported_error(const std::string& msg, |
9f4d1ef3 JG |
43 | const lttng::source_location& location) : |
44 | lttng::runtime_error(msg, location) | |
b6bbb1d6 JG |
45 | { |
46 | } | |
47 | ||
baac5795 | 48 | lttng::communication_error::communication_error(const std::string& msg, |
9f4d1ef3 JG |
49 | const lttng::source_location& location) : |
50 | runtime_error(msg, location) | |
baac5795 JG |
51 | { |
52 | } | |
53 | ||
54 | lttng::protocol_error::protocol_error(const std::string& msg, | |
9f4d1ef3 JG |
55 | const lttng::source_location& location) : |
56 | communication_error(msg, location) | |
baac5795 JG |
57 | { |
58 | } | |
59 | ||
60 | lttng::invalid_argument_error::invalid_argument_error(const std::string& msg, | |
9f4d1ef3 JG |
61 | const lttng::source_location& location) : |
62 | runtime_error(msg, location) | |
baac5795 JG |
63 | { |
64 | } |