Move HAproxy exceptions into their own class, and downgrade HAproxy errors since they are handled
This commit is contained in:
@@ -4,6 +4,8 @@ namespace App\Classes\Sock;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use App\Classes\Sock\Exception\{HAproxyException,SocketException};
|
||||
|
||||
final class SocketServer {
|
||||
private const LOGKEY = 'SS-';
|
||||
|
||||
@@ -128,8 +130,13 @@ final class SocketServer {
|
||||
try {
|
||||
$r = new SocketClient($accept);
|
||||
|
||||
} catch (HAproxyException $e) {
|
||||
Log::notice(sprintf('%s:! HAPROXY Exception [%s]',self::LOGKEY,$e->getMessage()));
|
||||
socket_close($accept);
|
||||
continue;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
Log::error(sprintf('%s:! Creating Socket client failed? [%s]',self::LOGKEY,$e->getMessage()));
|
||||
Log::notice(sprintf('%s:! Creating Socket client failed? [%s]',self::LOGKEY,$e->getMessage()));
|
||||
socket_close($accept);
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user