Public Member Functions | |
addError (string $error, int $code=500, array $errorData=[]) | |
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.
string | $error | Error message to add to container |
int | $code | HTTP Status code that is automatically set to the response object, default int(500), |
array | $errorData | Additional error data, default [] |
Implemented in SlaxWeb\Output\Handler\Json.