mcloud  1.0.0
MCloud API library for cmcc cloud service
exceptions.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program 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
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Gary Wang <gary.wang@canonical.com>
17  */
18 
19 #ifndef MCLOUD_API_EXCEPTIONS_H_
20 #define MCLOUD_API_EXCEPTIONS_H_
21 
22 #include <mcloud/api/visibility.h>
23 
24 #include <exception>
25 
26 namespace mcloud {
27 namespace api {
28 
34  class MCLOUD_API_DLL_PUBLIC InvalidIDException : public std::runtime_error {
35  public:
36  using runtime_error::runtime_error;
37  };
38 
39  /*
40  * \brief Indicates a content or folder can not be found on mcloud.
41  */
42  class MCLOUD_API_DLL_PUBLIC NonExistentException : public std::runtime_error {
43  public:
44  using runtime_error::runtime_error;
45  };
46 
50  class MCLOUD_API_DLL_PUBLIC OutofSpaceException : public std::runtime_error {
51  public:
52  using runtime_error::runtime_error;
53  };
54 
58  class MCLOUD_API_DLL_PUBLIC HttpTimeoutException : public std::runtime_error {
59  public:
60  using runtime_error::runtime_error;
61  };
62 
63  /*
64  * \brief Indicates one or more http request parameters are invalid.
65  */
66  class MCLOUD_API_DLL_PUBLIC ParameterInvalidException : public std::runtime_error {
67  public:
68  using runtime_error::runtime_error;
69  };
70 
71  /*
72  * \brief Indicates access token is invalid or expired.
73  */
74  class MCLOUD_API_DLL_PUBLIC CredentialException : public std::runtime_error {
75  public:
76  using runtime_error::runtime_error;
77  };
78 
79 }
80 }
81 
82 #endif // MCLOUD_API_EXCEPTIONS_H_
User ran out of space on mcloud storage.
Definition: exceptions.h:50
Definition: client.h:37
Indicates a timeout on HTTP requests.
Definition: exceptions.h:58
#define MCLOUD_API_DLL_PUBLIC
Definition: visibility.h:26
Indicates an invalid content id when querying content infomation by an id. or an invalid folder id wh...
Definition: exceptions.h:34