From fb7071adc4cf751b9ed53022891df0a2eb28b588 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 18 Oct 2023 10:59:15 +0900 Subject: [PATCH] Basic used Exception documentation What PHP Exception is used for what NOTE: Subject to change --- README.Exceptions.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 README.Exceptions.md diff --git a/README.Exceptions.md b/README.Exceptions.md new file mode 100644 index 00000000..41559f08 --- /dev/null +++ b/README.Exceptions.md @@ -0,0 +1,43 @@ +# Exception rules + +What exceptions to use for what + +NOTE: There will be custom Excpetions creaed and so some rules will change + +NOTE: For catching: always catch \Exception at the end to avoid missing some changed exceptions + +NOTE: Changed exceptions will have marked as critical API change + +## \Exception + +if there is nothing else matching, use this one + +## \InvalidArgumentException + +if argument to a function is not expected type + +## \UnexpectedValueException + +If the value is not matching to what we expect + +## \LengthException + +Given value is out of range + +## \RuntimeException + +Missing php modules or external programs + +## \OutOfRangeException + +Not in range of given expression (array or other) + +## Below are ERRORs + +### \ArgumentCountError [ERROR] + +If we have dynamic argument methods and we are missing a certain arguemnt count + +### \TypeError + +Invalid type