Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/ably/models/message_encoders/cipher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ def encode(message, channel_options)
add_encoding_to_message "#{ENCODING_ID}+#{crypto.cipher_params.cipher_type.downcase}", message
end
rescue ArgumentError => e
raise Ably::Exceptions::CipherError.new(e.message, nil, 92005)
# ably-os:inline-error-update:92005:2025-08-22:e8u Original: "#{e.message}"
raise Ably::Exceptions::CipherError.new("Encryption failed due to configuration error: #{e.message}. Check your cipher key format and message data", nil, 92005)
rescue RuntimeError => e
if e.message.match(/unsupported cipher algorithm/i)
raise Ably::Exceptions::CipherError.new(e.message, nil, 92004)
# ably-os:inline-error-update:92004:2025-08-22:e8u Original: "#{e.message}"
raise Ably::Exceptions::CipherError.new("Unsupported cipher algorithm specified. #{e.message}. Supported algorithms: AES-128-CBC, AES-256-CBC", nil, 92004)
else
raise e
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ably/modules/conversions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ def ensure_supported_payload(payload)
payload.kind_of?(Array) ||
payload.nil?

raise Ably::Exceptions::UnsupportedDataType.new('Invalid data payload', 400, Ably::Exceptions::Codes::INVALID_MESSAGE_DATA_OR_ENCODING)
# ably-os:inline-error-update:40013:2025-08-22:e8u Original: "Invalid data payload"
raise Ably::Exceptions::UnsupportedDataType.new("Invalid data payload: #{payload.class} is not supported. Use String, Hash, Array, or nil", 400, Ably::Exceptions::Codes::INVALID_MESSAGE_DATA_OR_ENCODING)
end

# Converts the name, data, attributes into the array of Message objects
Expand Down
3 changes: 2 additions & 1 deletion lib/ably/realtime/client/incoming_message_dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ def dispatch_protocol_message(*args)
client.auth.authorize

else
error = Ably::Exceptions::ProtocolError.new("Protocol Message Action #{protocol_message.action} is unsupported by this MessageDispatcher", 400, Ably::Exceptions::Codes::PROTOCOL_ERROR)
# ably-os:inline-error-update:80013:2025-08-22:e8u Original: "Protocol Message Action #{protocol_message.action} is unsupported by this MessageDispatcher"
error = Ably::Exceptions::ProtocolError.new("Protocol error: unsupported action '#{protocol_message.action}' received. Check your SDK version and protocol compatibility", 400, Ably::Exceptions::Codes::PROTOCOL_ERROR)
logger.fatal error.message
end
end
Expand Down
3 changes: 2 additions & 1 deletion lib/ably/realtime/presence.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,8 @@ def sync_complete?
def send_presence_protocol_message(presence_action, client_id, data, id = nil)
presence_message = create_presence_message(presence_action, client_id, data, id)
unless presence_message.client_id
raise Ably::Exceptions::Standard.new('Unable to enter create presence message without a client_id', 400, Ably::Exceptions::Codes::UNABLE_TO_ENTER_PRESENCE_CHANNEL_NO_CLIENTID)
# ably-os:inline-error-update:91000:2025-08-22:e8u Original: "Unable to enter create presence message without a client_id"
raise Ably::Exceptions::Standard.new('Unable to enter presence channel without a client_id', 400, Ably::Exceptions::Codes::UNABLE_TO_ENTER_PRESENCE_CHANNEL_NO_CLIENTID)
end

protocol_message = {
Expand Down
Loading