-
-
Notifications
You must be signed in to change notification settings - Fork 518
Closed
Description
the method generate_masked_cookie is coded as
def generate_masked_cookies(cookies)
cookies.merge(cookies) { STRING_MASK }
end
but on my API server (Grape + Rack & Puma)
the variable cookies is String like "(....)" result is a double exception in Sentry
where on top of the captured expression I get
NoMethodError
undefined method `merge' for "(...)":String
raven/processor/cookies.rb in generate_masked_cookies at line 33
would it be reasonable to check a little bit more if cookie quack as Hash ?
with something along the line bellow
def generate_masked_cookies(cookies)
return if cookies.nil?
cookies.merge(cookies) { STRING_MASK } if cookies.respond_to?(:merge)
end
It work well for me and I retrieved the proper capture inside Sentry along with proper execution of my
code, instead of the 'exception during captured exception' as with thus issue.