Added more slack debugging when using socket mode

This commit is contained in:
Deon George 2021-12-09 13:35:23 +11:00
parent 66031eff47
commit 2514bafd97

View File

@ -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();