Download the PHP package fyre/error without Composer
On this page you can find all versions of the php package fyre/error. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package error
FyreError
FyreError is a free, open-source error handling library for PHP.
Table Of Contents
- Installation
- Methods
- Middleware
- Exceptions
- Http Exceptions
Installation
Using Composer
In PHP:
Methods
Get Exception
Get the current Exception.
Get Renderer
Get the error renderer.
Handle
Handle an Exception.
Register
Register the error handler.
$options
is an array containing configuration options.log
is a boolean indicating whether to log errors, and will default to false.level
is an integer representing theerror_reporting
level.
Render
Render an Exception.
Set Renderer
Set the error renderer.
$renderer
is a Closure that accepts an Exception as the first argument.
The renderer should return a ClientResponse or a string.
Middleware
Process
$request
is a ServerRequest.$handler
is a RequestHandler.
This method will return a ClientResponse.
Exceptions
Custom exceptions can be created by extending the Fyre\Error\Exceptions\Exception
class.
$message
is a string representing the error message.$code
is a number representing the error code, and will default to 500.$previous
is an Exception representing the previous exception, and will default to null.
Http Exceptions
Bad Request
400 Bad Request error.
Unauthorized
401 Unauthorized error.
Forbidden
403 Forbidden error.
Not Found
404 Not Found error.
Method Not Allowed
405 Method Not Allowed error.
Not Acceptable
406 Not Acceptable error.
Conflict
409 Conflict error.
Gone
410 Gone error.
Internal Server
500 Internal Server error.
Not Implemented
501 Not Implemented error.
Service Unavailable
503 Service Unavailable error.
All versions of error with dependencies
fyre/middleware Version ^2.0
fyre/server Version ^3.0
fyre/log Version ^3.0