lxcpp: UID/GID setting in Attach
[platform/core/security/vasum.git] / libs / lxcpp / exception.hpp
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
18 /**
19  * @file
20  * @author  Mateusz Malicki (m.malicki2@samsung.com)
21  * @brief   lxcpp's exceptions definitions
22  */
23
24 #ifndef LXCPP_EXCEPTION_HPP
25 #define LXCPP_EXCEPTION_HPP
26
27 #include <stdexcept>
28
29 namespace lxcpp {
30
31 /**
32  * Base class for exceptions in lxcpp
33  */
34 struct Exception: public std::runtime_error {
35     Exception(const std::string& message)
36         : std::runtime_error(message) {}
37 };
38
39 struct NotImplementedException: public Exception {
40     NotImplementedException(const std::string& message = "Functionality not yet implemented")
41         : Exception(message) {}
42 };
43
44 struct ProcessSetupException: public Exception {
45     ProcessSetupException(const std::string& message = "Error during setting up a process")
46         : Exception(message) {}
47 };
48
49 struct FileSystemSetupException: public Exception {
50     FileSystemSetupException(const std::string& message = "Error during a file system operation")
51         : Exception(message) {}
52 };
53
54 struct EnvironmentSetupException: public Exception {
55     EnvironmentSetupException(const std::string& message = "Error during handling environment variables")
56         : Exception(message) {}
57 };
58
59 struct CredentialSetupException: public Exception {
60     CredentialSetupException(const std::string& message = "Error during handling environment variables")
61         : Exception(message) {}
62 };
63
64 struct CapabilitySetupException: public Exception {
65     CapabilitySetupException(const std::string& message = "Error during a capability operation")
66         : Exception(message) {}
67 };
68
69 struct BadArgument: public Exception {
70     BadArgument(const std::string& message = "Bad argument passed")
71         : Exception(message) {}
72 };
73
74 struct NoSuchValue: public Exception {
75     NoSuchValue(const std::string& message = "Value not found")
76         : Exception(message) {}
77 };
78
79 struct NetworkException : public Exception {
80     NetworkException (const std::string& message = "Error during setting up a network")
81         : Exception(message) {}
82 };
83
84 } // namespace lxcpp
85
86 #endif // LXCPP_EXCEPTION_HPP