error_handler.php

Error Handler

Defines function to catch and customize exceptions

Functions

_handleError()

_handleError(integer  $code, string  $description, string  $file = null, integer  $line = null, array<mixed,string>  $context = null) : void

Hanlde error

Format, log, terminate

Parameters

integer $code

Error code

string $description

Description

string $file

File

integer $line

Line

array<mixed,string> $context

Context

_logError()

_logError(array  $data = array()) : void

Writes report and terminates

Function-helper

Parameters

array $data

Error array

_fatalErrorShutdownHandler()

_fatalErrorShutdownHandler() : void

Fatal Error Shutdown Handler

Extreme output and terminate

_handleException()

_handleException(\Exception  $e) : void

Global Exception Handler

Writes logs and terminates, does all apiException's work

Parameters

\Exception $e

Unhandled exception

__ExceptionToArray()

__ExceptionToArray(\Exception  $e) : array

Exception To Array

Turnes \Exception object to Array

Parameters

\Exception $e

Input data

Returns

array —

Output array