diff mde/mergetag/exception.d @ 11:b940f267419e

Options class created & changes to mergetag exception messages. Options class created (barebones). Loading/saving from Init. Init no longer runs cleanup functions after initialisation failure. Improved mergetag exception messages & error reporting. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Thu, 21 Feb 2008 09:05:33 +0000
parents 4c3575400769
children bff0d802cb7d
line wrap: on
line diff
--- a/mde/mergetag/exception.d	Mon Feb 18 11:54:56 2008 +0000
+++ b/mde/mergetag/exception.d	Thu Feb 21 09:05:33 2008 +0000
@@ -18,23 +18,38 @@
     this (char[] msg) {
         super(msg);
     }
-    this () {}
+    this () {   // Only called when an unexpected exception/error occurs
+        super ("Unknown exception");
+    }
 }
 
 /** Thrown on file IO errors. */
 class MTFileIOException : MTException {
-    this () {}
+    this () {
+        super ("File IO exception");
+    }
 }
 
 /** Thrown on unknown format errors; when reading or writing and the filetype cannot be guessed. */
 class MTFileFormatException : MTException {
-    this () {}
+    this () {
+        super ("File format exception");
+    }
+}
+
+/** Thrown on syntax errors when reading; bad tags or unexpected EOF. */
+class MTSyntaxException : MTException {
+    this () {
+        super ("Syntax exception");
+    }
 }
 
 /** Thrown by addTag (in classes implementing dataset.DataSection) when a tag is read with an
  * unrecognised type field. */
 class MTUnknownTypeException : MTException {
-    this () {}
+    this () {
+        super ("Unknown type");
+    }
     this (char[] msg) {
         super (msg);
     }
@@ -43,17 +58,21 @@
 /** Thrown by addTag (in classes implementing dataset.DataSection) when a data parsing error occurs
 * (really just to make whoever called addTag to log a warning saying where the error occured). */
 class MTaddTagParseException : MTException {
-    this () {}
+    this () {
+        super ("Parse exception within addTag");
+    }
 }
 
+/+
 /// Thrown by TypeView.parse on errors.
 class MTBadTypeStringException : MTException {
     this () {}
 }
++/
 
 /// Thrown by *Writer.write.
 class MTNoDataSetException : MTException {
-    this (char[] msg) {
-        super(msg);
+    this () {
+        super ("No dataset");
     }
 }