lib/ably/exceptions.rb in ably-0.6.2 vs lib/ably/exceptions.rb in ably-0.7.0

- old
+ new

@@ -31,25 +31,39 @@ class CipherError < BaseAblyException; end # Encoding or decoding failure class EncoderError < BaseAblyException; end + # Connection error from Realtime or REST service + class ConnectionError < BaseAblyException + def initialize(message, status = nil, code = nil, base_error = nil) + super message, status, code + @base_error = base_error + end + end + + # Connection Timeout accessing Realtime or REST service + class ConnectionTimeoutError < ConnectionError; end + + # Invalid State Change error on a {https://github.com/gocardless/statesman Statesman State Machine} + class StateChangeError < BaseAblyException; end + # A generic Ably exception taht supports a status & code. # See https://github.com/ably/ably-common/blob/master/protocol/errors.json for a list of Ably errors class Standard < BaseAblyException; end # The HTTP request has returned a 500 error - class ServerError < StandardError; end + class ServerError < BaseAblyException; end # PaginatedResource cannot retrieve the page - class InvalidPageError < StandardError; end + class InvalidPageError < BaseAblyException; end # The expected response from the server was invalid - class InvalidResponseBody < StandardError; end + class InvalidResponseBody < BaseAblyException; end # The request cannot be performed because it is insecure - class InsecureRequestError < StandardError; end + class InsecureRequestError < BaseAblyException; end # The token request could not be created - class TokenRequestError < StandardError; end + class TokenRequestError < BaseAblyException; end end end