PHP Trait luya\traits\ErrorHandlerTrait

Author: nadar
Datei anzeigen Open project: luyadev/luya

Public Properties

Property Type Description
$api The url of the error api without trailing slash. Make sure you have installed the error api module on the requested api url (https://luya.io/guide/module/luyadev---luya-module-errorapi).
$transferException Enable the transfer of exceptions to the defined $api server.

Public Methods

Method Description
getExceptionArray ( mixed $exception ) : array Get an readable array to transfer from an exception
renderException ( $exception )
transferMessage ( string $message, string $file = __FILE__, string $line = __LINE__ ) Send a custom message to the api server event its not related to an exception.

Private Methods

Method Description
apiServerSendData ( array $data ) : boolean | null Send the array data to the api server.
buildTrace ( $exception )

Method Details

getExceptionArray() public method

Get an readable array to transfer from an exception
public getExceptionArray ( mixed $exception ) : array
$exception mixed Exception object
return array An array with transformed exception data

renderException() public method

public renderException ( $exception )

transferMessage() public method

Sometimes you just want to pass informations to your application, this method allows you to transfer a message to your error api server. Example of sending a message php Yii::$app->errorHandler->transferMessage('Something went wrong here!', __FILE__, __LINE__);
public transferMessage ( string $message, string $file = __FILE__, string $line = __LINE__ )
$message string The message you want to send to the error api server.
$file string The you are currently send the message (use __FILE__)
$line string The line you want to submit (use __LINE__)

Property Details

$api public_oe property

The url of the error api without trailing slash. Make sure you have installed the error api module on the requested api url (https://luya.io/guide/module/luyadev---luya-module-errorapi).
public $api

$transferException public_oe property

Enable the transfer of exceptions to the defined $api server.
public $transferException