Ausnahmen
In der MF-Welt sollte es im Idealfall keine klassischen PHP-Fehler geben. Alle Fehler werden in Exceptions verwandelt, welche besser vom Programmierer gehandhabt werden können.
Das Framework benötigt die SPL Erweiterung, welche allerdings standardmäßig aktiviert sein sollte. Dies erlaubt die Verwendung der folgenden Ausnahmeklassen:
Exception | core | Exception Basisklasse |
ErrorException | core | Fehler, die zu Ausnahmen umgewandelt wurden |
BadFunctionCallException | spl | Exception thrown if a callback refers to an undefined function or if some arguments are missing |
BadMethodCallException | spl | Exception thrown if a callback refers to an undefined method or if some arguments are missing |
DomainException | spl | A domain exception |
InvalidArgumentException | spl | Exception thrown if a argument does not match with the expected value |
LengthException | spl | Exception thrown if a length is invalid |
LogicException | spl | Exception thrown if a logic expression is invalid |
OutOfBoundsException | spl | Exception thrown if a value is not a valid key |
OutOfRangeException | spl | Exception thrown when a value does not match with a range |
OverflowException | spl | Exception thrown when you add an element into a full container |
RangeException | spl | Exception thrown when an invalid range is given |
RuntimeException | spl | Exception thrown if an error which can only be found on runtime occurs |
UnderflowException | spl | Exception thrown when you try to remove an element of an empty container |
UnexpectedValueException | spl | Exception thrown if a value does not match with a set of values |
Mammut vervollständigt dies um einige weitere Ausnahmen:
Klasse | Namespace | Info | Autoload | Basis |
---|---|---|---|---|
MFExtensionException | Mammut.Exception | Exception thrown when a required extension is missing | y | Exception |
MFIllegalStateException | Mammut.Exception | n | RuntimeException | |
MFImplementationException | Mammut.Exception | Exception thrown when a implementation is missing | n | Exception |
MFIOException | Mammut.IO | Generic I/O exception | y | RuntimeException |
MFFileNotFoundException | Mammut.IO | Exception thrown when a file or directory is not found | y | MFIOException |
Weitere Ausnahmen können kontextspezifisch existieren.