diff --git a/lib/stream-chat/errors.rb b/lib/stream-chat/errors.rb index 4ce5cf8..5dfebf8 100644 --- a/lib/stream-chat/errors.rb +++ b/lib/stream-chat/errors.rb @@ -4,6 +4,9 @@ module StreamChat class StreamAPIException < StandardError + attr_reader :error_code + attr_reader :error_message + def initialize(response) super() @response = response @@ -24,6 +27,14 @@ def message "StreamChat error HTTP code: #{@response.status}" end end + + def json_response? + @json_response + end + + def to_s + message + end end class StreamChannelException < StandardError; end