Move HAproxy exceptions into their own class, and downgrade HAproxy errors since they are handled

This commit is contained in:
2024-06-01 12:55:27 +10:00
parent 73cf421739
commit 38795b83bf
12 changed files with 37 additions and 32 deletions

View File

@@ -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;
}