Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exception.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License version 2.1 as published by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16  */
17 
24 #ifndef LXCPP_EXCEPTION_HPP
25 #define LXCPP_EXCEPTION_HPP
26 
27 #include <stdexcept>
28 
29 namespace lxcpp {
30 
34 struct Exception: public std::runtime_error {
35  explicit Exception(const std::string& message)
36  : std::runtime_error(message) {}
37 };
38 
40  explicit NotImplementedException(const std::string& message = "Functionality not yet implemented")
41  : Exception(message) {}
42 };
43 
45  explicit ProcessSetupException(const std::string& message = "Error while setting up a process")
46  : Exception(message) {}
47 };
48 
50  explicit FileSystemSetupException(const std::string& message = "Error during a file system operation")
51  : Exception(message) {}
52 };
53 
55  explicit EnvironmentSetupException(const std::string& message = "Error during handling environment variables")
56  : Exception(message) {}
57 };
58 
60  explicit CredentialSetupException(const std::string& message = "Error during handling environment variables")
61  : Exception(message) {}
62 };
63 
65  explicit CapabilitySetupException(const std::string& message = "Error during a capability operation")
66  : Exception(message) {}
67 };
68 
69 struct UtilityException: public Exception {
70  explicit UtilityException(const std::string& message = "Error during an utility operation")
71  : Exception(message) {}
72 };
73 
74 struct TerminalException: public Exception {
75  explicit TerminalException(const std::string& message = "Error during a terminal operation")
76  : Exception(message) {}
77 };
78 
79 struct BadArgument: public Exception {
80  explicit BadArgument(const std::string& message = "Bad argument passed")
81  : Exception(message) {}
82 };
83 
84 struct NoSuchValue: public Exception {
85  explicit NoSuchValue(const std::string& message = "Value not found")
86  : Exception(message) {}
87 };
88 
89 struct NetworkException : public Exception {
90  explicit NetworkException (const std::string& message = "Error during setting up a network")
91  : Exception(message) {}
92 };
93 
94 struct CGroupException : public Exception {
95  explicit CGroupException (const std::string& message = "Error during setting up a cgroup")
96  : Exception(message) {}
97 };
98 
99 struct ConfigureException: public Exception {
100  explicit ConfigureException(const std::string& message = "Error while configuring a container")
101  : Exception(message) {}
102 };
103 
105  explicit ProvisionException(const std::string& message = "Provision error")
106  : Exception(message) {}
107 };
108 
109 struct UserNSException: public Exception {
110  explicit UserNSException(const std::string& message = "User namespace error")
111  : Exception(message) {}
112 };
113 
115  explicit ForbiddenActionException(const std::string& message = "Forbidden action")
116  : Exception(message) {}
117 };
118 
119 } // namespace lxcpp
120 
121 #endif // LXCPP_EXCEPTION_HPP
Definition: exception.hpp:114
Definition: exception.hpp:94
NetworkException(const std::string &message="Error during setting up a network")
Definition: exception.hpp:90
Definition: exception.hpp:99
Definition: exception.hpp:89
Exception(const std::string &message)
Definition: exception.hpp:35
Base class for exceptions in lxcpp.
Definition: exception.hpp:34
Definition: exception.hpp:54
Definition: exception.hpp:79
TerminalException(const std::string &message="Error during a terminal operation")
Definition: exception.hpp:75
Definition: exception.hpp:104
Definition: exception.hpp:49
Definition: exception.hpp:84
CGroupException(const std::string &message="Error during setting up a cgroup")
Definition: exception.hpp:95
Definition: exception.hpp:69
Definition: exception.hpp:59
CapabilitySetupException(const std::string &message="Error during a capability operation")
Definition: exception.hpp:65
CredentialSetupException(const std::string &message="Error during handling environment variables")
Definition: exception.hpp:60
ProcessSetupException(const std::string &message="Error while setting up a process")
Definition: exception.hpp:45
Definition: exception.hpp:74
ConfigureException(const std::string &message="Error while configuring a container")
Definition: exception.hpp:100
ProvisionException(const std::string &message="Provision error")
Definition: exception.hpp:105
ForbiddenActionException(const std::string &message="Forbidden action")
Definition: exception.hpp:115
UtilityException(const std::string &message="Error during an utility operation")
Definition: exception.hpp:70
BadArgument(const std::string &message="Bad argument passed")
Definition: exception.hpp:80
NoSuchValue(const std::string &message="Value not found")
Definition: exception.hpp:85
NotImplementedException(const std::string &message="Functionality not yet implemented")
Definition: exception.hpp:40
Definition: exception.hpp:64
FileSystemSetupException(const std::string &message="Error during a file system operation")
Definition: exception.hpp:50
Definition: exception.hpp:109
Definition: exception.hpp:39
Definition: exception.hpp:44
EnvironmentSetupException(const std::string &message="Error during handling environment variables")
Definition: exception.hpp:55
UserNSException(const std::string &message="User namespace error")
Definition: exception.hpp:110