More debugging trying to catch websocket connect errors
This commit is contained in:
parent
b69220b1ce
commit
1e5281de29
@ -89,8 +89,8 @@ class SocketMode extends API
|
|||||||
// initiate the websocket connection
|
// initiate the websocket connection
|
||||||
// write PHPWS things to the existing logger
|
// write PHPWS things to the existing logger
|
||||||
$this->websocket = new WebSocket($response['url'].($this->debug_reconnect ? '&debug_reconnects=true' : ''),$this->loop,$this->logger);
|
$this->websocket = new WebSocket($response['url'].($this->debug_reconnect ? '&debug_reconnects=true' : ''),$this->loop,$this->logger);
|
||||||
$this->websocket->on('message', function ($message) {
|
$this->websocket->on('message', function ($message) use ($response) {
|
||||||
Log::debug(sprintf('%s:- Calling onMessage ...',self::LOGKEY),['m'=>__METHOD__]);
|
Log::debug(sprintf('%s:- Calling onMessage ...',self::LOGKEY),['m'=>__METHOD__,'payload'=>serialize($response),'message'=>serialize($message)]);
|
||||||
$this->onMessage($message);
|
$this->onMessage($message);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -169,7 +169,11 @@ class SocketMode extends API
|
|||||||
Log::debug(sprintf('%s:+ Start',self::LOGKEY),['m'=>__METHOD__]);
|
Log::debug(sprintf('%s:+ Start',self::LOGKEY),['m'=>__METHOD__]);
|
||||||
|
|
||||||
// parse the message and get the event name
|
// parse the message and get the event name
|
||||||
$payload = Payload::fromJson($message->getData());
|
try {
|
||||||
|
$payload = Payload::fromJson($message->getData());
|
||||||
|
} catch (\UnexpectedValueException $e) {
|
||||||
|
Log::error(sprintf('%s:! ERROR in json payload in onMessage',self::LOGKEY),['message'=>serialize($message)]);
|
||||||
|
}
|
||||||
$emitted = FALSE;
|
$emitted = FALSE;
|
||||||
|
|
||||||
if (isset($payload['type'])) {
|
if (isset($payload['type'])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user