lib/assets/javascripts/firehose/transport.js.coffee in firehose-0.0.9 vs lib/assets/javascripts/firehose/transport.js.coffee in firehose-0.0.10
- old
+ new
@@ -19,15 +19,20 @@
# Sub classes need to implement this method to handle requests
_request: =>
# Default error handler
_error: (event) =>
- # Lets try to connect again with delay
- @config.disconnected()
- @connect(@_retryDelay)
+ unless @_succeeded
+ # Fail peremantly if the error happens on the first connection.
+ @config.failed(this)
+ else
+ # Lets try to connect again with delay
+ @config.disconnected()
+ @connect(@_retryDelay)
# Default connection established handler
_open: (event) =>
+ @_succeeded = true
@config.connected()
# Default connection closed handler
_close: (event) =>
@config.disconnected()
\ No newline at end of file