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