node-slack-events-api icon indicating copy to clipboard operation
node-slack-events-api copied to clipboard

waitForResponse option doesn't always work for errors

Open aoberoi opened this issue 9 years ago • 0 comments

Description

If the waitForResponse option is enabled and the event handling code throws or has a runtime error, then the adapter will catch it and emit an 'error' event. In this case, that event will only have an argument for the error value. Since the response callback is not given, the http request will hang and time out.

What type of issue is this? (place an x in one of the [ ])

  • [x] bug
  • [ ] enhancement (feature request)
  • [ ] question
  • [ ] documentation related
  • [ ] testing related
  • [ ] discussion

Requirements

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slack-events version: 1.0.0 node version: 6.x OS version(s): macOS 10.12.3

Steps to reproduce:

  1. enable waitForResponse option for the SlackEventAdapter.
  2. attach a handler for a Slack event that throws
  3. attach an error handler that accepts an error and a callback argument.
  4. actuate the Slack event.

Expected result:

the callback argument should be a function with signature (error, responseOptions) and upon calling it the response should be sent for the request.

Actual result:

the callback arugument is undefined

aoberoi avatar Mar 02 '17 21:03 aoberoi