/** * Construct an instance of a LackOfCoffeeException. * * @param string $message * @param int $code * @param Exception|null $previous */ public function __construct($message = '', $code = 0, Exception $previous = null) { if ($message == '') { $message = static::DEFAULT_PREFIX . ' Coffee time!'; } else { $message = static::DEFAULT_PREFIX . ' ' . $message; } parent::__construct($message, $code, $previous); }
public function __construct($sIssue, $aContext, $oException = null) { if ($oException != null) { $aContext['mysql_error'] = $oException->getCode(); $aContext['mysql_errno'] = $oException->getMessage(); } else { $aContext['mysql_error'] = CMDBSource::GetError(); $aContext['mysql_errno'] = CMDBSource::GetErrNo(); } parent::__construct($sIssue, $aContext); }
public function __construct($sIssue, $sInput, $iLine, $iCol, $sUnexpected, $aExpecting = null) { $this->m_MyIssue = $sIssue; $this->m_sInput = $sInput; $this->m_iLine = $iLine; $this->m_iCol = $iCol; $this->m_sUnexpected = $sUnexpected; $this->m_aExpecting = $aExpecting; if (is_null($this->m_aExpecting) || count($this->m_aExpecting) == 0) { $sMessage = "{$sIssue} - found '{$this->m_sUnexpected}' at {$iCol} in '{$sInput}'"; } else { $sExpectations = '{' . implode(', ', $this->m_aExpecting) . '}'; $sSuggest = self::FindClosestString($this->m_sUnexpected, $this->m_aExpecting); $sMessage = "{$sIssue} - found '{$this->m_sUnexpected}' at {$iCol} in '{$sInput}', expecting {$sExpectations}, I would suggest to use '{$sSuggest}'"; } // make sure everything is assigned properly parent::__construct($sMessage, 0); }
public function __construct($error) { parent::__construct($this->formatErrorMessage($error)); }
public function __construct($message) { parent::__construct($message); $this->code = '01'; }