Vesthelm Engine

2.1.1 User Guide

Exceptions Class

The Exceptions class provides error handling and logging functions.

Calling the Exceptions Class

$Exceptions = $this->Exceptions;

Showing Debug Message

Note: If V_DEBUG (includes/config.inc.php) constant value equal 0 you will not see debug message in your browser otherwise check log files in compile_dir/log directory.

$this->Exceptions->debugMessage('Test error message'); //Outputs debug page
or
debug_message('Test error message'); //Outputs debug page

The second argument allows you to choose error type (by default: E_USER_ERROR). All error types:

array(
    E_ERROR => "Error",
    E_WARNING => "Warning",
    E_PARSE => "Parsing Error",
    E_NOTICE => "Notice",
    E_CORE_ERROR => "Core Error",
    E_CORE_WARNING => "Core Warning",
    E_COMPILE_ERROR => "Compile Error",
    E_COMPILE_WARNING => "Compile Warning",
    E_USER_ERROR => "User Error",
    E_USER_WARNING => "User Warning",
    E_USER_NOTICE => "User Notice",
    E_STRICT => "Runtime Notice", //5.0.0
    E_RECOVERABLE_ERROR => "Recoverable Error", //5.2.0
    E_DEPRECATED => "Deprecated", //5.3.0
    E_USER_DEPRECATED => "User Deprecated" //5.3.0
);

Specifying error type:

$this->Exceptions->debugMessage('Test error message', E_USER_ERROR);