lib/ably/modules/encodeable.rb in ably-0.6.2 vs lib/ably/modules/encodeable.rb in ably-0.7.0
- old
+ new
@@ -1,6 +1,7 @@
require 'base64'
+require 'ably/exceptions'
module Ably::Modules
# Provides methods to allow this model's `data` property to be encoded and decoded based on the `encoding` property.
#
# This module expects the following:
@@ -55,11 +56,11 @@
end
end until previous_encoding == message_hash[:encoding]
set_hash_object message_hash
rescue Ably::Exceptions::CipherError => cipher_error
- channel.client.logger.error "Encoder error #{cipher_error.code} trying to #{method} message: #{cipher_error.message}"
if channel.respond_to?(:trigger)
+ channel.client.logger.error "Encoder error #{cipher_error.code} trying to #{method} message: #{cipher_error.message}"
channel.trigger :error, cipher_error
else
raise cipher_error
end
end