4375f815931910f4a5bc9a919db8e89875c30c27
[lttng-tools.git] / src / common / exception.cpp
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"
9
10 #include <common/error.hpp>
11
12 #include <sstream>
13
14 lttng::ctl::error::error(const std::string& msg,
15 lttng_error_code error_code,
16 const lttng::source_location& location) :
17 runtime_error(msg, location), _error_code{ error_code }
18 {
19 }
20
21 lttng::posix_error::posix_error(const std::string& msg,
22 unsigned int errno_code,
23 const lttng::source_location& location) :
24 std::system_error(errno_code, std::generic_category()), lttng::runtime_error(msg, location)
25 {
26 }
27
28 lttng::runtime_error::runtime_error(const std::string& msg,
29 const lttng::source_location& location) :
30 std::runtime_error(msg), source_location(location)
31 {
32 }
33
34 lttng::allocation_failure::allocation_failure(const std::string& msg,
35 std::size_t allocation_size_,
36 const lttng::source_location& location) :
37 lttng::runtime_error(msg, location), allocation_size(allocation_size_)
38 {
39 }
40
41 lttng::unsupported_error::unsupported_error(const std::string& msg,
42 const lttng::source_location& location) :
43 lttng::runtime_error(msg, location)
44 {
45 }
46
47 lttng::communication_error::communication_error(const std::string& msg,
48 const lttng::source_location& location) :
49 runtime_error(msg, location)
50 {
51 }
52
53 lttng::protocol_error::protocol_error(const std::string& msg,
54 const lttng::source_location& location) :
55 communication_error(msg, location)
56 {
57 }
58
59 lttng::invalid_argument_error::invalid_argument_error(const std::string& msg,
60 const lttng::source_location& location) :
61 runtime_error(msg, location)
62 {
63 }
This page took 0.030013 seconds and 3 git commands to generate.