libAllure
 
Loading...
Searching...
No Matches
libAllure\ErrorHandler Class Reference

Public Member Functions

 __construct (bool $greedy=true)
 
 beGreedy ()
 
 beLazy ()
 
 handleException ($obj)
 
 handleHttpError ($code)
 
 handlePhpError ($code, $message, $file, $line)
 
 null ()
 
 renderSfe ($obj)
 
 setCss ($css)
 

Static Public Member Functions

static errorCodeToString ($code)
 
static getInstance ()
 

Static Public Attributes

static $instance
 

Protected Member Functions

 clearOutputBuffers ()
 
 render ($trigger, $message, $code=null, $file=null, $line=null, $stacktrace=null)
 
 renderHtml ($trigger, $message, $code=null, $file=null, $line=null, $stacktrace=null)
 

Protected Attributes

 $css = "margin: auto; width: 75%; background-color: #FFBCBA; border: 2px solid black; line-height: 1.5; padding: 6px; font-family: Verdana, Sans-Serif; font-size: 9pt; text-align: left;"
 
 $cssErrorTitle = 'background-color: red; color: white; text-align: left; margin: 0; padding: .5em; font-size: 12pt;'
 

Constructor & Destructor Documentation

◆ __construct()

libAllure\ErrorHandler::__construct ( bool  $greedy = true)

Constructs the new class.

Parameters
$greedyWhether or not this class can be greedy: is allowed to capture all types of errors that it can bind to.

Member Function Documentation

◆ getInstance()

static libAllure\ErrorHandler::getInstance ( )
static
Returns
ErrorHandler

◆ render()

libAllure\ErrorHandler::render (   $trigger,
  $message,
  $code = null,
  $file = null,
  $line = null,
  $stacktrace = null 
)
protected

Print the error out.

Parameters
$triggerWhat triggored this error.
$messageThe message for the error.
$codeThe code for the error.
$fileThe file that this error came from.
$lineThe line that this error came from.
$stacktraceA stacktrace leading up to this error ( should be a array).