Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Rename details to sentry_context
Browse files Browse the repository at this point in the history
This will help our error reporting in Sentry - so we can understand a
bit better where the errors are coming from.
  • Loading branch information
alexstoick committed Jun 21, 2023
1 parent 700d325 commit ff43201
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/ruby_snowflake_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ module Snowflake
LOG_LEVEL = 0

class Error < StandardError
attr_reader :details
# This will get pulled through to Sentry, see:
# https://github.com/getsentry/sentry-ruby/blob/11ecd254c0d2cae2b327f0348074e849095aa32d/sentry-ruby/lib/sentry/error_event.rb#L31-L33
attr_reader :sentry_context

def initialize(details)
@details = details
@sentry_context = details
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/snowflake/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
it "should raise an exception" do
expect { result }.to raise_error do |error|
expect(error).to be_a Snowflake::Error
expect(error.details).to include(
expect(error.sentry_context).to include(
sql: query
)
end
Expand Down

0 comments on commit ff43201

Please sign in to comment.