Odyssey
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
CatchExceptionHandler Class Reference
Inheritance diagram for CatchExceptionHandler:
CatchHandler

Public Member Functions

 __construct ($pSetProduct, $pSetLogger=null, $pDevMode=false)
 
 catchException ($pException)
 
 logException ($pException)
 
- Public Member Functions inherited from CatchHandler
 __construct ($pSetProduct, $pSetLogger=null)
 
 setLogger ($pLogger)
 
 setDevMode ($pDevMode)
 
 getDevMode ()
 
 setErrorReporting ($pNewReportLvl)
 
 getErrorReporting ()
 

Protected Member Functions

 getErrMsg ()
 
- Protected Member Functions inherited from CatchHandler
 handleError ()
 
 setSaveLog ($pSaveLog)
 
 getErrMsg ()
 
 setNotice ($pNoticeOnly)
 

Private Member Functions

 getSaveLog ()
 

Private Attributes

 $errException = null
 

Additional Inherited Members

- Protected Attributes inherited from CatchHandler
 $errLogger = null
 
 $errReportLvl = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
 
 $errRemoteAddr
 
 $errRequestUri
 
 $errServerName
 
 $errPhpSelf
 
 $errScriptName
 
 $errQueryString
 

Detailed Description

Definition at line 218 of file hcuLogError.i.

Member Function Documentation

◆ catchException()

CatchExceptionHandler::catchException (   $pException)

Exception was triggered Include an error handling script that will be presented to the user

Definition at line 235 of file hcuLogError.i.

235  {
236 
237  $this->logException($pException);
238 
239  /**
240  *
241  * Exception was triggered
242  * Include an error handling script that will be presented to the user
243  *
244  */
245 
246  include_once(dirname(__FILE__) . '/../../shared/includes/hcuBadRequest.i');
247  exit;
248 
249  }
logException($pException)
Definition: hcuLogError.i:256

◆ getErrMsg()

CatchExceptionHandler::getErrMsg ( )
protected

Build the error message from the exception information Specific to the exception object

Parameters
int$pType- (0-Format error for Log File, 1-Format error for e-mail)
Returns
string Returns formatted error string

For dev mode add extra informaition to the log file

Definition at line 276 of file hcuLogError.i.

276  {
277  $lRetStr = '';
278  $lCurDate = date("Ymd:His");
279 
280  $lRetStr = <<< LOGMSG
281 [{$lCurDate}] {$this->errException->getCode()} [{$this->errRemoteAddr}] [{$this->errServerName}{$this->errPhpSelf}?{$this->errQueryString}] [{$this->errException->getFile()}] [Line {$this->errException->getLine()}] [{$this->errException->getCode()}] {$this->errException->getMessage()}
282 LOGMSG;
283 
284  if ($this->getDevMode()) {
285  /**
286  * For dev mode add extra informaition to the log file
287  *
288  */
289  $lRetStr .= $this->errException->getTraceAsString();
290  }
291  return $lRetStr;
292  }

◆ logException()

CatchExceptionHandler::logException (   $pException)

This will log the exception information to the specified error log

Parameters
object$pExceptionThis is the exception object that was thrown

Definition at line 256 of file hcuLogError.i.

256  {
257 
258  $this->errException = $pException;
259 
260  $this->setSaveLog($this->getSaveLog());
261 
262  parent::handleError();
263 
264  }

The documentation for this class was generated from the following file: