-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathi3_ipc_invalid_argument.hpp
More file actions
66 lines (51 loc) · 1.88 KB
/
Copy pathi3_ipc_invalid_argument.hpp
File metadata and controls
66 lines (51 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
Copyright (C) 2019, Ivan Balević
This file is part of "i3-ipc++" library.
"i3-ipc++" is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
"i3-ipc++" is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with "i3-ipc++". If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file i3_ipc_invalid_argument.hpp
*
* \brief Defines "i3_ipc_invalid_argument" class used for throwing errors when user provides invalid arguments.
*/
#ifndef I3_IPC_INVALID_ARGUMENT_HPP
#define I3_IPC_INVALID_ARGUMENT_HPP
// Library headers.
#include "i3_ipc_exception.hpp"
// C++ headers.
#include <string_view>
/**
* \brief Exception class used only when user provides bad arguments to the "i3-ipc++" library.
*/
class i3_ipc_invalid_argument : public i3_ipc_exception
{
public:
/**
* \brief Constructs exception class with error message.
*
* \param [in] a_error_message Error message used to explain what went wrong.
*/
i3_ipc_invalid_argument(std::string_view a_error_message);
/**
* \brief Function explaining what went wrong.
*
* \return Error message.
*/
virtual const char* what() const noexcept;
/**
* \brief Sets new error message.
*
* \param [in] a_error_message Error message used to explain what went wrong.
*/
void set_error_message(std::string_view a_error_message);
};
#endif // I3_IPC_INVALID_ARGUMENT_HPP