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

Copyright © 2012-2021 Canonical Ltd.
Generated on Mon Jul 5 13:30:06 UTC 2021
This documentation is licensed under the GPL version 2 or 3.