. * * @package LibreNMS * @link http://librenms.org * @copyright 2016 Tony Murray * @author Tony Murray */ namespace LibreNMS\Exceptions; class HostUnreachableException extends \Exception { protected $reasons = array(); public function __toString() { $string = __CLASS__ . ": [{$this->code}]: {$this->message}\n"; foreach ($this->reasons as $reason) { $string .= " $reason\n"; } return $string; } /** * Add additional reasons * @param $message */ public function addReason($message) { $this->reasons[] = $message; } /** * Get the reasons * @return array */ public function getReasons() { return $this->reasons; } }