Merge pull request #745 from connectkushal/patch-1

Create 09-02-01-Errors.md
This commit is contained in:
Phil Sturgeon
2017-06-14 11:07:17 -04:00
committed by GitHub

View File

@@ -134,6 +134,8 @@ the `Exception` class.
This is a common practice implemented by a large number of modern frameworks such as Symfony and Laravel. In debug This is a common practice implemented by a large number of modern frameworks such as Symfony and Laravel. In debug
mode *(or dev mode)* both of these frameworks will display a nice and clean *stack trace*. mode *(or dev mode)* both of these frameworks will display a nice and clean *stack trace*.
There are also some packages available for better error and exception handling and reporting. Like [Whoops!], which comes with the default installation of Laravel and can be used in any framework as well.
By throwing errors as exceptions in development you can handle them better than the usual result, and if you see an By throwing errors as exceptions in development you can handle them better than the usual result, and if you see an
exception during development you can wrap it in a catch statement with specific instructions on how to handle the exception during development you can wrap it in a catch statement with specific instructions on how to handle the
situation. Each exception you catch instantly makes your application that little bit more robust. situation. Each exception you catch instantly makes your application that little bit more robust.