Add throw error function
This commit is contained in:
1 parent
d7922ef29e
commit
b754374b79
1 file changed
+7
-1
+7
-1
@@ -96,6 +96,12 @@ class PhpObject
|
||||
$this->addMessage(self::ERROR_TAB, $sError);
|
||||
}
|
||||
|
||||
protected function throwError(string $sError): never
|
||||
{
|
||||
$this->addError($sError);
|
||||
throw new \RuntimeException($sError);
|
||||
}
|
||||
|
||||
private function addMessage($sType, $sMessage)
|
||||
{
|
||||
$this->asMessageStack[$sType][] = array('msg'=>$sMessage, 'time'=>date('d.m.Y H:i:s'), 'type'=>$sType, 'location'=>$this->sChildClass);
|
||||
@@ -194,4 +200,4 @@ class PhpObject
|
||||
{
|
||||
$this->cleanMessageStack();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user