N°3270 Notify on expiration not sending notification (trigger exception)

add boilerplate function and use it to intercept/enrich trigger exception loops
This commit is contained in:
odain
2020-08-21 18:10:48 +02:00
parent 94b9a9bb75
commit 4e0eed6e13
8 changed files with 173 additions and 13 deletions

View File

@@ -28,7 +28,7 @@
class CoreException extends Exception
{
public function __construct($sIssue, $aContextData = null, $sImpact = '')
public function __construct($sIssue, $aContextData = null, $sImpact = '', $oPrevious = null)
{
$this->m_sIssue = $sIssue;
$this->m_sImpact = $sImpact;
@@ -66,7 +66,7 @@ class CoreException extends Exception
}
$sMessage .= implode(', ', $aContextItems);
}
parent::__construct($sMessage, 0);
parent::__construct($sMessage, 0, $oPrevious);
}
/**
@@ -81,6 +81,16 @@ class CoreException extends Exception
return $this->getMessage();
}
/**
* getTraceAsString() cannot be overrided and it is limited as only current exception stack is returned.
* we need stack of all previous exceptions
* @uses __tostring() already does the work.
* @since 2.7.2/ 2.8.0
*/
public function getFullStackTraceAsString(){
return "" . $this;
}
public function getTraceAsHtml()
{
$aBackTrace = $this->getTrace();