Mercurial > projects > mde
comparison mde/setup/exception.d @ 85:56c0ddd90193
Intermediate commit (not stable). Changes to init system.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Thu, 11 Sep 2008 11:33:51 +0100 |
parents | 66d555da083e |
children |
comparison
equal
deleted
inserted
replaced
84:e0f1ec7fe73a | 85:56c0ddd90193 |
---|---|
11 See the GNU General Public License for more details. | 11 See the GNU General Public License for more details. |
12 | 12 |
13 You should have received a copy of the GNU General Public License | 13 You should have received a copy of the GNU General Public License |
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ | 14 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
15 | 15 |
16 /// Contains the exception classes for Init. | 16 /** Contains the exception classes for Init, and the StageState type to remove the need for init |
17 * functions to import other Init modules. */ | |
17 module mde.setup.exception; | 18 module mde.setup.exception; |
18 | 19 |
19 import mde.exception; | 20 import mde.exception; |
20 | 21 |
21 /// Thrown when Init fails. | 22 /// Thrown when Init fails. |
27 this (char[] msg) { | 28 this (char[] msg) { |
28 super(msg); | 29 super(msg); |
29 } | 30 } |
30 } | 31 } |
31 | 32 |
32 /// Thrown when an init stage fails. | 33 /// State of an InitStage. |
34 enum StageState : byte { | |
35 INACTIVE = 0, /// run init on startup | |
36 ACTIVE = 1, /// run cleanup on shutdown | |
37 ERROR = -1, /// locked; don't run init or cleanup | |
38 } | |
39 | |
40 /// May be thrown when an init or cleanup function fails to explicitly set the stage's state. | |
33 class InitStageException : InitException { | 41 class InitStageException : InitException { |
34 this () { | 42 this (StageState s) { |
43 state = s; | |
35 super(""); | 44 super(""); |
36 } | 45 } |
46 StageState state; | |
37 } | 47 } |