ErrorManager
class ErrorManager extends Singleton
The main error handler/manager
This class handles uncaught exceptions, logging them and converting to a client Output object. Application code can use LogException() when an exception is caught but still needs to be logged.
Properties
| static private | $instances | from Singleton | |
| private | $API | ||
| private | $interface | ||
| private | $filelogok | if false, the file-based log encountered an error on the last entry |
|
| private | $dblogok | if false, the DB-based log encountered an error on the last entry |
|
| private | $debuglog |
Methods
Returns true if the configured debug state is >= the requested level
Handles a client exception, rolling back the DB, displaying debug data and returning an Output
Handles a non-client exception, rolling back the DB, logging debug data and returning an Output
No description
Adds an entry to the custom debug log, saved with exceptions
Returns the debug log if allowed by the debug state, else null
Creates an exception and logs it to the main error log (to get a backtrace)
Details
at line 58
__construct(IOInterface $interface)
Registers PHP error and exception handlers
at line 28
private bool
GetDebugState(int $minlevel)
Returns true if the configured debug state is >= the requested level
at line 36
private Output
HandleClientException(ClientException $e)
Handles a client exception, rolling back the DB, displaying debug data and returning an Output
at line 47
private Output
HandleThrowable(Throwable $e)
Handles a non-client exception, rolling back the DB, logging debug data and returning an Output
at line 83
__destruct()
No description
at line 85
ErrorManager
SetAPI(Main $api)
No description
at line 101
array|null
LogException(Throwable $e, bool $mainlog = true)
Log an exception to file (json) and database
A new database connection is used for the log entry
at line 147
ErrorManager
LogDebug($data)
Adds an entry to the custom debug log, saved with exceptions
at line 150
array|null
GetDebugLog()
Returns the debug log if allowed by the debug state, else null
at line 153
ErrorManager
LogBreakpoint()
Creates an exception and logs it to the main error log (to get a backtrace)