diff mde/exception.d @ 7:b544c3a7c9ca

Some changes to exceptions and a few more debug commands. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Wed, 16 Jan 2008 12:48:07 +0000
parents 9a990644948c
children f63f4f41a2dc
line wrap: on
line diff
--- a/mde/exception.d	Thu Jan 10 18:33:24 2008 +0000
+++ b/mde/exception.d	Wed Jan 16 12:48:07 2008 +0000
@@ -4,18 +4,18 @@
 /** Base class for all mde Exceptions.
  *
  * All packages should have their own base exception type extending this one, and for each package
- * level a CTOR taking a message should pass the message to the super prepended with "package: ".
- * The performance of this is unimportant since exceptions are only intended for recovering from
- * unexpected errors anyway. A CTOR not taking a message and calling the super without a parameter
- * should also be provided.
+ * level a CTOR taking a message should pass the message to the super. The const string symbol
+ * should be overriden as below so that it ends up as something like "mde.file" or
+ * "mde.pkg.file.Class" describing where the exception was thrown.
+ * A CTOR not taking a message and calling the super without a parameter may also be provided.
  */
 class mdeException : Exception {
-    const symbol = "mde";	/// Override in derived classes.
+    const symbol = "mde";	/// Override in derived classes to name the module where the error occured.
     this (char[] msg) {
         super(symbol ~ ": " ~ msg);
     }
-    this () {
-        super("");	// Exception doesn't have a this() CTOR
+    this () {			// No supplied error message.
+        super(symbol);
     }
 }