annotate mde/mergetag/exception.d @ 25:2c28ee04a4ed

Some minor and some futile efforts. Played around with init functions, had problems, gave up and put them back. Removed idea for multiple init stages; it's not good for performance or simplicity. Adjusted exception messages. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 03 Apr 2008 17:26:52 +0100
parents 5f90774ea1ef
children 611f7b9063c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
1 /* LICENSE BLOCK
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
2 Part of mde: a Modular D game-oriented Engine
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
3 Copyright © 2007-2008 Diggory Hardy
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
4
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
5 This program is free software; you can redistribute it and/or modify it under the terms of
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
6 the GNU General Public License, version 2, as published by the Free Software Foundation.
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
7
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
8 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
9 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
10 See the GNU General Public License for more details.
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
11
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
12 You should have received a copy of the GNU General Public License along
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
13 with this program; if not, write to the Free Software Foundation, Inc.,
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
5f90774ea1ef Applied the GNU GPL v2 to mde.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 15
diff changeset
15
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
16 /*******************************************
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
17 * Contains exception classes for MergeTag.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
18 *
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
19 * Publically imports mde.exception.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
20 ******************************************/
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
21 module mde.mergetag.exception;
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
22
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
23 public import mde.exception;
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
24
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
25 /// Base MergeTag exception class.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
26 class MTException : mdeException {
10
4c3575400769 DefaultData largely rewritten with unittest, SDL input event handling completed with unittest, changes to Init threading.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 8
diff changeset
27 char[] getSymbol () {
25
2c28ee04a4ed Some minor and some futile efforts.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 17
diff changeset
28 return super.getSymbol ~ ".mergetag";
10
4c3575400769 DefaultData largely rewritten with unittest, SDL input event handling completed with unittest, changes to Init threading.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 8
diff changeset
29 }
4c3575400769 DefaultData largely rewritten with unittest, SDL input event handling completed with unittest, changes to Init threading.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 8
diff changeset
30
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
31 this (char[] msg) {
7
b544c3a7c9ca Some changes to exceptions and a few more debug commands.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
32 super(msg);
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
33 }
11
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
34 this () { // Only called when an unexpected exception/error occurs
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
35 super ("Unknown exception");
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
36 }
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
37 }
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
38
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
39 /** Thrown on file IO errors. */
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
40 class MTFileIOException : MTException {
11
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
41 this () {
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
42 super ("File IO exception");
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
43 }
15
4608be19ebe2 Use OS paths (linux only for now), merging multiple paths. Init changes regarding options.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 14
diff changeset
44 this (char[] msg) {
4608be19ebe2 Use OS paths (linux only for now), merging multiple paths. Init changes regarding options.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 14
diff changeset
45 super (msg);
4608be19ebe2 Use OS paths (linux only for now), merging multiple paths. Init changes regarding options.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 14
diff changeset
46 }
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
47 }
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
48
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
49 /** Thrown on unknown format errors; when reading or writing and the filetype cannot be guessed. */
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
50 class MTFileFormatException : MTException {
11
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
51 this () {
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
52 super ("File format exception");
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
53 }
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
54 }
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
55
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
56 /** Thrown on syntax errors when reading; bad tags or unexpected EOF. */
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
57 class MTSyntaxException : MTException {
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
58 this () {
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
59 super ("Syntax exception");
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
60 }
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
61 }
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
62
14
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
63 /** Thrown by addTag (in classes implementing IDataSection) when a data parsing error occurs
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
64 * (really just to make whoever called addTag to log a warning saying where the error occured). */
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
65 class MTaddTagParseException : MTException {
11
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
66 this () {
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
67 super ("Parse exception within addTag");
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
68 }
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
69 }
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
70
11
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
71 /+
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
72 /// Thrown by TypeView.parse on errors.
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
73 class MTBadTypeStringException : MTException {
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
74 this () {}
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
75 }
11
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
76 +/
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
77
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
78 /// Thrown by *Writer.write.
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
79 class MTNoDataSetException : MTException {
11
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
80 this () {
b940f267419e Options class created & changes to mergetag exception messages.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 10
diff changeset
81 super ("No dataset");
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
82 }
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 1
diff changeset
83 }
14
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
84
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
85 /// Thrown when attempting to use an unimplemented part of the package
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
86 /// Really, just until MTB stuff is implemented
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
87 class MTNotImplementedException : MTException {
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
88 this () {
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
89 super ("Functionality not implemented!");
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
90 }
0047b364b6d9 Changed much of the mergetag structure and some functionality. First tests on windows.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 12
diff changeset
91 }