Convenience mixin for trivially sub-classing exceptions
Even trivially sub-classing an exception involves writing boilerplate code
for the constructor to: 1) correctly pass in the source file and line number
the exception was thrown from; 2) be usable with enforce which
expects exception constructors to take arguments in a fixed order. This
mixin provides that boilerplate code.
Note however that you need to mark the mixin line with at least a
minimal (i.e. just ///) DDoc comment if you want the mixed-in
constructors to be documented in the newly created Exception subclass.
Current limitation: Due to
bug #11500,
currently the constructors specified in this mixin cannot be overloaded with
any other custom constructors. Thus this mixin can currently only be used
when no such custom constructors need to be explicitly specified.
Convenience mixin for trivially sub-classing exceptions
Even trivially sub-classing an exception involves writing boilerplate code for the constructor to: 1) correctly pass in the source file and line number the exception was thrown from; 2) be usable with enforce which expects exception constructors to take arguments in a fixed order. This mixin provides that boilerplate code.
Note however that you need to mark the mixin line with at least a minimal (i.e. just ///) DDoc comment if you want the mixed-in constructors to be documented in the newly created Exception subclass.
Current limitation: Due to bug #11500, currently the constructors specified in this mixin cannot be overloaded with any other custom constructors. Thus this mixin can currently only be used when no such custom constructors need to be explicitly specified.