Skip to content

Commit

Permalink
Merge pull request #10 from shiena/error_callback
Browse files Browse the repository at this point in the history
Fixed a bug that stops `Room(roomId).Messages().listen()` If an error occurs in the http request
  • Loading branch information
kaibadash authored Apr 22, 2017
2 parents 41e794f + 67d3fbf commit 76bff98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/chatwork.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,13 @@ class ChatworkStreaming extends EventEmitter

response.on "error", (err) ->
logger.error "Chatwork HTTPS response error: #{err}"
callback err, {}
if callback
callback err, {}

request.end body, 'binary'

request.on "error", (err) ->
logger.error "Chatwork request error: #{err}"
if callback
callback err, {}

0 comments on commit 76bff98

Please sign in to comment.