lxcpp: provisioning implementation (part 2)
[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 vasum {
33
34
35 /**
36  * Base class for exceptions in Vasum Server
37  */
38 struct ServerException: public VasumException {
39
40     explicit ServerException(const std::string& error) : VasumException(error) {}
41 };
42
43 /**
44  * Error occurred during an attempt to perform an operation on a zone,
45  * e.g. start, stop a zone
46  */
47 struct ZoneOperationException: public ServerException {
48
49     explicit ZoneOperationException(const std::string& error) : ServerException(error) {}
50 };
51
52 /**
53  * Invalid zone id
54  */
55 struct InvalidZoneIdException : public ServerException {
56
57     explicit InvalidZoneIdException(const std::string& error) : ServerException(error) {}
58 };
59
60 /**
61  * Exception during performing an operation on a zone connection
62  */
63 struct ZoneConnectionException: public ServerException {
64
65     explicit ZoneConnectionException(const std::string& error) : ServerException(error) {}
66 };
67
68 /**
69  * Exception during performing an operation on a host connection
70  */
71 struct HostConnectionException: public ServerException {
72
73     explicit HostConnectionException(const std::string& error) : ServerException(error) {}
74 };
75
76 /**
77 * Exception during performing an operation by input monitor,
78 * e.g. create channel, register callback etc.
79 */
80 struct InputMonitorException: public ServerException {
81
82     explicit InputMonitorException(const std::string& error) : ServerException(error) {}
83 };
84
85 struct TimeoutException: public InputMonitorException {
86
87     explicit TimeoutException(const std::string& error) : InputMonitorException (error) {}
88 };
89
90 }
91
92
93 #endif // SERVER_EXCEPTION_HPP