Setting the active container through D-Bus
[platform/core/security/vasum.git] / server / exception.hpp
1 /*
2  *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Contact: Jan Olszak <j.olszak@samsung.com>
5  *
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License
17  */
18
19 /**
20  * @file
21  * @author  Jan Olszak (j.olszak@samsung.com)
22  * @brief   Exceptions for the server
23  */
24
25
26 #ifndef SERVER_EXCEPTION_HPP
27 #define SERVER_EXCEPTION_HPP
28
29 #include "base-exception.hpp"
30
31
32 namespace security_containers {
33
34
35 /**
36  * Base class for exceptions in Security Containers Server
37  */
38 struct ServerException: public SecurityContainersException {
39
40     ServerException(const std::string& error = "") : SecurityContainersException(error) {}
41 };
42
43 /**
44  * Error occurred during an attempt to perform an operation on a container,
45  * e.g. start, stop a container
46  */
47 struct ContainerOperationException: public ServerException {
48
49     ContainerOperationException(const std::string& error = "") : ServerException(error) {}
50 };
51
52 /**
53  * Exception during performing an operation on a container connection
54  */
55 struct ContainerConnectionException: public ServerException {
56
57     ContainerConnectionException(const std::string& error = "") : ServerException(error) {}
58 };
59
60 /**
61  * Exception during performing an operation on a host connection
62  */
63 struct HostConnectionException: public ServerException {
64
65     HostConnectionException(const std::string& error = "") : ServerException(error) {}
66 };
67
68 /**
69 * Exception during performing an operation by input monitor,
70 * e.g. create channel, register callback etc.
71 */
72 struct InputMonitorException: public ServerException {
73
74     InputMonitorException(const std::string& error = "") : ServerException(error) {}
75 };
76
77
78 }
79
80
81 #endif // SERVER_EXCEPTION_HPP