A basic, abstract exceptions class
This library provides just a single abstract exception class with it's own bild() method for easily creating exceptions with various properties, passed as an array of arguments.
Just have a look at the
src/CubicMushroom/Exceptions/AbstractException class methods for basic methods, but here is a
build() method that can be used to prepare exceptions to be thrown.
build(), you don't need to pass in a $message, $code. If you don't the default for the class will be
used. This is returned by the classes
getDefaultCode() methods, if they exist.
As it's not helpful when an exception doesn't have a message, if no message is either passed, or a default set in the
exception class, a
MissingExceptionMessageException will be thrown.
build() method also accepts a second array parameter. If passed, the
build() method will attempt to set all the
properties on the build exception using the setter for the property. If the setter is not found, then a
SetterNotFoundException will be thrown.
- Add way of defining required additional parameters
- More stuff, as I think of it