Download the PHP package krmgns/errorise without Composer
On this page you can find all versions of the php package krmgns/errorise. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download krmgns/errorise
More information about krmgns/errorise
Files in krmgns/errorise
Package errorise
Short Description An elegant way to handle errors in PHP.
License Apache-2.0
Homepage https://github.com/krmgns/errorise
Informations about the package errorise
If you are tired of using the @
error suppression operator and then digging for errors with the error_get_last()
function, you can try using Errorise. Errorise offers well-caught PHP errors to handle them on your side, freeing you from these stuff for each error-prone call.
Installing
Using ErrorHandler
Using ErrorHandler
for Specific Functions / Patterns
You can controll that when to throw or for which function or message pattern to throw.
Using ErrorHandler
for Undefined Variables
Like for function errors, ErrorHandler
is available for undefined variable errors as well:
Using ErrorHandler
with Non-Auto Mode
If you want full controll on register / unregister routine, pass $auto
argument as false
, just like:
Getting Error Messages in Catch
You can get error messages by using two methods of caught ErrorException
.
Utilising Error
Object
To get more details, you can utilise the $error
property of the ErrorHandler
which is passed to the caught ErrorException
.
Using ErrorWrapper
You can use ErrorWrapper
to wrap your calls instead of using try/catch blocks.
Manually Handling the Last Errors
You can use LastErrorException
to throw errors after checking your call results.