Skip to content

ErrorController

Class Controller

Inherited methods

setStatusCode

Sets the status code and message for a response.

public setStatusCode(int $code = 200, string|null $message = null): \Phalcon\Http\ResponseInterface

Parameters:

Parameter Type Description
$code int The HTTP status code to set. Default is 200.
$message **string null**

Return Value:

The updated response object.


errorAction

Http Status Code - Generic error

public errorAction(?int $code = null, ?string $message = null): void

Parameters:

Parameter Type Description
$code ?int
$message ?string

badRequestAction

Http Status Code 400 bad-request

public badRequestAction(): void

unauthorizedAction

Http Status Code 401 unauthorized

public unauthorizedAction(): void

forbiddenAction

Http Status Code 403 forbidden

public forbiddenAction(): void

notFoundAction

Http Status Code 404 not-found

public notFoundAction(): void

fatalAction

Http Status Code 500 fatal

public fatalAction(): void

maintenanceAction

Http Status Code 503 maintenance

public maintenanceAction(): void

initialize

public initialize(): void