PHP Класс Webiny\Component\Rest\RestErrorException

Implemented methods can throw this exception to notify the rest component that there has been an error.
Наследование: extends Webiny\Component\StdLib\Exception\AbstractException
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$code Error code.
$description Error description.
$errors Additional error messages. Useful if you wish to return a validation error, this can be used to store errors per-field.
$message Error message.
$responseCode Http response code that should be send with the error. Default is 404.

Открытые методы

Метод Описание
__construct ( string $message, string $description = '', string $code = '', integer $responseCode = 404 ) Base constructor.
addError ( array $error ) Add an additional error to the exception.
getErrorCode ( ) : string Get error code.
getErrorDescription ( ) : string Get error description.
getErrorMessage ( ) : string Get the error message.
getErrors ( ) : array Get the list of all additional errors.
getResponseCode ( ) : integer
setResponseCode ( $responseCode )

Описание методов

__construct() публичный Метод

Base constructor.
public __construct ( string $message, string $description = '', string $code = '', integer $responseCode = 404 )
$message string Error message.
$description string Error description.
$code string Error code.
$responseCode integer Http response code that should be send with the error. Default is 404.

addError() публичный Метод

Add an additional error to the exception.
public addError ( array $error )
$error array Addition error.

getErrorCode() публичный Метод

Get error code.
public getErrorCode ( ) : string
Результат string

getErrorDescription() публичный Метод

Get error description.
public getErrorDescription ( ) : string
Результат string

getErrorMessage() публичный Метод

Get the error message.
public getErrorMessage ( ) : string
Результат string

getErrors() публичный Метод

Get the list of all additional errors.
public getErrors ( ) : array
Результат array

getResponseCode() публичный Метод

public getResponseCode ( ) : integer
Результат integer Returns the http response code.

setResponseCode() публичный Метод

public setResponseCode ( $responseCode )
$responseCode Http response code that should be send with the error. Default is 404.

Описание свойств

$code защищенное свойство

Error code.
protected $code

$description защищенное свойство

Error description.
protected $description

$errors защищенное свойство

Additional error messages. Useful if you wish to return a validation error, this can be used to store errors per-field.
protected $errors

$message защищенное свойство

Error message.
protected $message

$responseCode защищенное свойство

Http response code that should be send with the error. Default is 404.
protected $responseCode