view mde/mergetag/exception.d @ 15:4608be19ebe2

Use OS paths (linux only for now), merging multiple paths. Init changes regarding options. Reorganised policies.txt a little. Implemented mde.resource.paths to read config from appropriate paths (currently linux only). Changed Init to load options before all other delegates are run and set logging level from options. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 14 Mar 2008 11:39:45 +0000
parents 0047b364b6d9
children 5f90774ea1ef
line wrap: on
line source

/*******************************************
 * Contains exception classes for MergeTag.
 *
 * Publically imports mde.exception.
 ******************************************/
module mde.mergetag.exception;

public import mde.exception;

/// Base MergeTag exception class.
class MTException : mdeException {
    static const char[] symbol;
    static this() {	symbol = super.symbol ~ ".mergetag";	}
    char[] getSymbol () {
        return symbol;
    }
    
    this (char[] msg) {
        super(msg);
    }
    this () {   // Only called when an unexpected exception/error occurs
        super ("Unknown exception");
    }
}

/** Thrown on file IO errors. */
class MTFileIOException : MTException {
    this () {
        super ("File IO exception");
    }
    this (char[] msg) {
        super (msg);
    }
}

/** Thrown on unknown format errors; when reading or writing and the filetype cannot be guessed. */
class MTFileFormatException : MTException {
    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 IDataSection) 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 () {
        super ("Parse exception within addTag");
    }
}

/+
/// Thrown by TypeView.parse on errors.
class MTBadTypeStringException : MTException {
    this () {}
}
+/

/// Thrown by *Writer.write.
class MTNoDataSetException : MTException {
    this () {
        super ("No dataset");
    }
}

/// Thrown when attempting to use an unimplemented part of the package
/// Really, just until MTB stuff is implemented
class MTNotImplementedException : MTException {
    this () {
        super ("Functionality not implemented!");
    }
}