Skip to content

Commit

Permalink
Merge kwargs earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuap committed Oct 19, 2023
1 parent 87fe569 commit 96a1bd2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/honeybadger/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def initialize(opts = {})
#
# @return [String] UUID reference to the notice within Honeybadger.
# @return [false] when ignored.
def notify(exception_or_opts=nil, opts={}, **kwargs)
def notify(exception_or_opts = nil, opts = {}, **kwargs)
opts = opts.dup
opts.merge!(kwargs)

if exception_or_opts.is_a?(Exception)
already_reported_notice_id = exception_or_opts.instance_variable_get(:@__hb_notice_id)
Expand All @@ -132,8 +133,6 @@ def notify(exception_or_opts=nil, opts={}, **kwargs)
opts[:error_message] = exception_or_opts.to_s
end

opts = opts.merge(kwargs)

validate_notify_opts!(opts)

add_breadcrumb(
Expand Down

0 comments on commit 96a1bd2

Please sign in to comment.