From 2514bafd97f98cdbb55e17ef844b05ee6fbdf845 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 9 Dec 2021 13:35:23 +1100 Subject: [PATCH] Added more slack debugging when using socket mode --- src/Client/SocketMode.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Client/SocketMode.php b/src/Client/SocketMode.php index dacb797..d5cc54d 100644 --- a/src/Client/SocketMode.php +++ b/src/Client/SocketMode.php @@ -95,6 +95,7 @@ class SocketMode extends API return $this->websocket->open(); }, function($exception) use ($deferred) { + Log::error(sprintf('%s:! Could not connect to Slack API [%s]...',self::LOGKEY,$exception->getMessage()),['m'=>__METHOD__]); // if connection was not successful $deferred->reject(new ConnectionException( 'Could not connect to Slack API: '.$exception->getMessage(), @@ -118,6 +119,14 @@ class SocketMode extends API 'Could not connect to WebSocket: '.$data['error']['msg'], $data['error']['code'])); }); + + }, function($exception) use ($deferred) { + Log::error(sprintf('%s:! Could not connect to Slack API [%s]...',self::LOGKEY,$exception->getMessage()),['m'=>__METHOD__]); + // if connection was not successful + $deferred->reject(new ConnectionException( + 'Could not connect to Slack API: '.$exception->getMessage(), + $exception->getCode() + )); }); return $deferred->promise();