Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.

catch and log payload handling errors #46

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nopolabs
Copy link

It doesn't look like you are maintaining slack-client any longer, but my bot receives killer channel_archive messages from Slack, I haven't caught the message itself, but here is the result:

PHP Fatal error: Uncaught ErrorException: Illegal string offset 'id' in /home/kip/php-kip/vendor/coderstephen/slack-client/src/RealTimeClient.php:406

This PR attempts to ameliorate by catching and logging errors thrown while handling payloads.

@sagebind
Copy link
Owner

I'd avoid Throwable if possible, since the library is currently targeting PHP 5.5+. We could boost it to PHP 7+ only as a new version, but we can't because there's some known compatibility issues between the websocket library being used and PHP 7.

@nopolabs
Copy link
Author

I have changed the PR to use \Exception instead.
I am using a fork of devristo/phpws with updated react/socket and react/socket-client dependencies nopolabs/phpws@40c0be6 and haven't had any troubles.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants