SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
SlaxWeb\Output\Interfaces\ErrorHandler Interface Reference
Inheritance diagram for SlaxWeb\Output\Interfaces\ErrorHandler:
Inheritance graph
[legend]

Public Member Functions

 addError (string $error, int $code=500, array $errorData=[])
 

Member Function Documentation

SlaxWeb\Output\Interfaces\ErrorHandler::addError ( string  $error,
int  $code = 500,
array  $errorData = [] 
)

Add error to response

When an error is added, the status code is automatically set to $code, which defaults to int(500). This method only adds the error message to the local error container. The output still needs to be written to response with the Output Manager object.

Parameters
string$errorError message to add to container
int$codeHTTP Status code that is automatically set to the response object, default int(500),
array$errorDataAdditional error data, default []
Returns
self

Implemented in SlaxWeb\Output\Handler\Json.


The documentation for this interface was generated from the following file: