Exception style changes.

This commit is contained in:
Ferdinand Majerech 2014-07-23 18:15:13 +02:00
parent f8c1d0204b
commit 8f00c503e2

View file

@ -64,7 +64,7 @@ abstract class MarkedYAMLException : YAMLException
{ {
// Construct a MarkedYAMLException with specified context and problem. // Construct a MarkedYAMLException with specified context and problem.
this(string context, Mark contextMark, string problem, Mark problemMark, this(string context, Mark contextMark, string problem, Mark problemMark,
string file = __FILE__, int line = __LINE__) @safe pure string file = __FILE__, int line = __LINE__) @safe pure nothrow
{ {
const msg = context ~ '\n' ~ const msg = context ~ '\n' ~
(contextMark != problemMark ? contextMark.toString() ~ '\n' : "") ~ (contextMark != problemMark ? contextMark.toString() ~ '\n' : "") ~
@ -81,6 +81,8 @@ abstract class MarkedYAMLException : YAMLException
} }
// Constructors of YAML exceptions are mostly the same, so we use a mixin. // Constructors of YAML exceptions are mostly the same, so we use a mixin.
//
// See_Also: YAMLException
template ExceptionCtors() template ExceptionCtors()
{ {
public this(string msg, string file = __FILE__, int line = __LINE__) public this(string msg, string file = __FILE__, int line = __LINE__)
@ -91,6 +93,8 @@ template ExceptionCtors()
} }
// Constructors of marked YAML exceptions are mostly the same, so we use a mixin. // Constructors of marked YAML exceptions are mostly the same, so we use a mixin.
//
// See_Also: MarkedYAMLException
template MarkedExceptionCtors() template MarkedExceptionCtors()
{ {
public: public:
@ -106,4 +110,9 @@ template MarkedExceptionCtors()
{ {
super(problem, problemMark, file, line); super(problem, problemMark, file, line);
} }
this(ref const(MarkedYAMLExceptionData) data) @safe pure nothrow
{
super(data);
}
} }