Просмотр исходного кода

Throw RuntimeException if socket resource is missing

The socket resource can be closed, purged or lost during the runtime of an application.
It is valid concern, because the resource is acquired and used at different times during request.

LogicException is more for static preconditions that have to be valid before function call.
Adam Brodziak 9 лет назад
Родитель
Сommit
eca984b647
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/Monolog/Handler/SyslogUdp/UdpSocket.php

+ 1 - 1
src/Monolog/Handler/SyslogUdp/UdpSocket.php

@@ -42,7 +42,7 @@ class UdpSocket
     protected function send($chunk)
     {
         if (!is_resource($this->socket)) {
-            throw new \LogicException('The UdpSocket to '.$this->ip.':'.$this->port.' has been closed and can not be written to anymore');
+            throw new \RuntimeException('The UdpSocket to '.$this->ip.':'.$this->port.' has been closed and can not be written to anymore');
         }
         socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port);
     }