{"action":"created","issue":{"url":"https://api.github.com/repos/slackapi/node-slack-sdk/issues/472","repository_url":"https://api.github.com/repos/slackapi/node-slack-sdk","labels_url":"https://api.github.com/repos/slackapi/node-slack-sdk/issues/472/labels{/name}","comments_url":"https://api.github.com/repos/slackapi/node-slack-sdk/issues/472/comments","events_url":"https://api.github.com/repos/slackapi/node-slack-sdk/issues/472/events","html_url":"https://github.com/slackapi/node-slack-sdk/issues/472","id":303482614,"number":472,"title":"Register handler for specific errors","user":{"login":"wilhelmklopp","id":7718702,"avatar_url":"https://avatars1.githubusercontent.com/u/7718702?v=4","gravatar_id":"","url":"https://api.github.com/users/wilhelmklopp","html_url":"https://github.com/wilhelmklopp","followers_url":"https://api.github.com/users/wilhelmklopp/followers","following_url":"https://api.github.com/users/wilhelmklopp/following{/other_user}","gists_url":"https://api.github.com/users/wilhelmklopp/gists{/gist_id}","starred_url":"https://api.github.com/users/wilhelmklopp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilhelmklopp/subscriptions","organizations_url":"https://api.github.com/users/wilhelmklopp/orgs","repos_url":"https://api.github.com/users/wilhelmklopp/repos","events_url":"https://api.github.com/users/wilhelmklopp/events{/privacy}","received_events_url":"https://api.github.com/users/wilhelmklopp/received_events","type":"User","site_admin":false},"labels":[{"id":635482259,"url":"https://api.github.com/repos/slackapi/node-slack-sdk/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-08T13:40:12Z","updated_at":"2018-03-09T23:31:39Z","closed_at":null,"author_association":"NONE","body":"### Description\r\n👋 It would be cool if there was a way to register a handler for specific errors, so that we can take an action when they occur. As an example, for the [GitHub Integration](https://github.com/integrations/slack) we want to disable an active subscription whenever we get an `is_archived` error from any of the 5+ places where we invoke chat.postMessage.\r\n\r\nWe're thinking something like:\r\n`client.on('is_archived', disableSubscriptions)`\r\n\r\nDescribe your issue here.\r\n\r\n### What type of issue is this? (place an `x` in one of the `[ ]`)\r\n- [ ] bug\r\n- [X] enhancement (feature request)\r\n- [ ] question\r\n- [ ] documentation related\r\n- [ ] testing related\r\n- [ ] discussion\r\n\r\n### Requirements (place an `x` in each of the `[ ]`)\r\n* [X] I've read and understood the [Contributing guidelines](https://github.com/slackapi/node-slack-sdk/blob/master/.github/contributing.md) and have done my best effort to follow them.\r\n* [X] I've read and agree to the [Code of Conduct](https://slackhq.github.io/code-of-conduct).\r\n* [X] I've searched for any related issues and avoided creating a duplicate issue.\r\n"},"comment":{"url":"https://api.github.com/repos/slackapi/node-slack-sdk/issues/comments/371975020","html_url":"https://github.com/slackapi/node-slack-sdk/issues/472#issuecomment-371975020","issue_url":"https://api.github.com/repos/slackapi/node-slack-sdk/issues/472","id":371975020,"user":{"login":"aoberoi","id":494795,"avatar_url":"https://avatars2.githubusercontent.com/u/494795?v=4","gravatar_id":"","url":"https://api.github.com/users/aoberoi","html_url":"https://github.com/aoberoi","followers_url":"https://api.github.com/users/aoberoi/followers","following_url":"https://api.github.com/users/aoberoi/following{/other_user}","gists_url":"https://api.github.com/users/aoberoi/gists{/gist_id}","starred_url":"https://api.github.com/users/aoberoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aoberoi/subscriptions","organizations_url":"https://api.github.com/users/aoberoi/orgs","repos_url":"https://api.github.com/users/aoberoi/repos","events_url":"https://api.github.com/users/aoberoi/events{/privacy}","received_events_url":"https://api.github.com/users/aoberoi/received_events","type":"User","site_admin":false},"created_at":"2018-03-09T23:31:39Z","updated_at":"2018-03-09T23:31:39Z","author_association":"OWNER","body":"cool! this isn't on the immediate action list right now, but if a PR shows up, I'd gladly merge 😄 "}}
{"actor":{"display_login":"aoberoi"}}