Mir
abnormal_exit.h
Go to the documentation of this file.
1/*
2 * Copyright © 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 2 or 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
17
18#ifndef MIR_ABNORMAL_EXIT_H_
19#define MIR_ABNORMAL_EXIT_H_
20
21#include <stdexcept>
22
23namespace mir
24{
25/// Indicates Mir should exit with an error message printed to stderr
26class AbnormalExit : public std::runtime_error
27{
28public:
29 AbnormalExit(std::string const& what) :
30 std::runtime_error(what)
31 {
32 }
33};
34
35/// Indicates Mir should exit with the given output (such as help text) printed to stdout
37{
38public:
39 ExitWithOutput(std::string const& what) :
41 {
42 }
43};
44}
45
46
47#endif /* MIR_ABNORMAL_EXIT_H_ */
Indicates Mir should exit with an error message printed to stderr.
Definition: abnormal_exit.h:27
AbnormalExit(std::string const &what)
Definition: abnormal_exit.h:29
Indicates Mir should exit with the given output (such as help text) printed to stdout.
Definition: abnormal_exit.h:37
ExitWithOutput(std::string const &what)
Definition: abnormal_exit.h:39
Definition: runner.h:27

Copyright © 2012-2023 Canonical Ltd.
Generated on Tue 2 May 10:01:24 UTC 2023
This documentation is licensed under the GPL version 2 or 3.