mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Livestatus\Connection: implement socketError method
This commit is contained in:
parent
be8120bd39
commit
d66c95a725
@ -257,6 +257,20 @@ class Connection
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Raise an exception showing given message string and last socket error
|
||||||
|
*
|
||||||
|
* TODO: Find a better exception type for such errors
|
||||||
|
*
|
||||||
|
* @throws IcingaException
|
||||||
|
*/
|
||||||
|
protected function socketError($msg)
|
||||||
|
{
|
||||||
|
throw new IcingaException(
|
||||||
|
$msg . ': ' . socket_strerror(socket_last_error($this->connection))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected function assertPhpExtensionLoaded($name)
|
protected function assertPhpExtensionLoaded($name)
|
||||||
{
|
{
|
||||||
if (! extension_loaded($name)) {
|
if (! extension_loaded($name)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user