Renamed std.encoding.Exception to EncodingException

This commit is contained in:
Janice Caron 2008-05-06 16:38:17 +00:00
parent 02232cabd1
commit ab4da381b0

View file

@ -1840,7 +1840,7 @@ body
}
}
/**
/*
* Convert a string from one encoding to another. (See also transcode() above).
*
* The input to this function MUST be validly encoded.
@ -1878,9 +1878,9 @@ body
//=============================================================================
/** The base class for exceptions thrown by this module */
class Exception : object.Exception { this(string msg) { super(msg); } }
class EncodingException : Exception { this(string msg) { super(msg); } }
class UnrecognizedEncodingException : Exception
class UnrecognizedEncodingException : EncodingException
{
private this(string msg) { super(msg); }
}
@ -1909,7 +1909,7 @@ abstract class EncodingScheme
{
auto scheme = cast(EncodingScheme)Object.factory(className);
if (scheme is null)
throw new Exception("Unable to create class "~className);
throw new EncodingException("Unable to create class "~className);
foreach(encodingName;scheme.names())
{
supported[tolower(encodingName)] = className;
@ -1932,10 +1932,10 @@ abstract class EncodingScheme
{
auto p = std.string.tolower(encodingName) in supported;
if (p is null)
throw new Exception("Unrecognized Encoding: "~encodingName);
throw new EncodingException("Unrecognized Encoding: "~encodingName);
string className = *p;
auto scheme = cast(EncodingScheme)Object.factory(className);
if (scheme is null) throw new Exception("Unable to create class "~className);
if (scheme is null) throw new EncodingException("Unable to create class "~className);
return scheme;
}