From a49558698fddcbb6c6b52ba8cc484899ec96c884 Mon Sep 17 00:00:00 2001 From: Stoica Alexandru Date: Thu, 19 Dec 2024 17:07:28 +0000 Subject: [PATCH] Parse exception detail OR message --- lib/ruby_snowflake/client.rb | 7 ++++++- lib/ruby_snowflake/version.rb | 2 +- spec/ruby_snowflake/client_spec.rb | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/ruby_snowflake/client.rb b/lib/ruby_snowflake/client.rb index f71b9f3..1e09b2f 100644 --- a/lib/ruby_snowflake/client.rb +++ b/lib/ruby_snowflake/client.rb @@ -32,7 +32,12 @@ def initialize(details) end def message - @details + if @details == {} + super + else + @details.to_s + end + end end diff --git a/lib/ruby_snowflake/version.rb b/lib/ruby_snowflake/version.rb index 35ab0f1..c816759 100644 --- a/lib/ruby_snowflake/version.rb +++ b/lib/ruby_snowflake/version.rb @@ -1,3 +1,3 @@ module RubySnowflake - VERSION = "1.1.4" + VERSION = "1.1.5" end diff --git a/spec/ruby_snowflake/client_spec.rb b/spec/ruby_snowflake/client_spec.rb index 5757ef8..3152f7a 100644 --- a/spec/ruby_snowflake/client_spec.rb +++ b/spec/ruby_snowflake/client_spec.rb @@ -101,8 +101,9 @@ expect { result }.to raise_error do |error| expect(error).to be_a RubySnowflake::QueryTimeoutError end + # We are not receiving this error because we cancel it before Snowflake can expect(client.logger).not_to have_received(:error).with(a_string_including("cancel query")) - expect(Time.now.to_i - start_time).to be_between(1.0, 5) + expect(Time.now.to_i - start_time).to be >= 1 #query timeout end end