Skip to content

Commit 0c48ef3

Browse files
segiddinssimi
authored andcommitted
Change to only logging when unable to parse user agent
1 parent ba422e5 commit 0c48ef3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/models/events/recordable.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def record_event!(tag, request: Current.request, **additional)
99
begin
1010
user_agent_info = Gemcutter::UserAgentParser.call(user_agent)
1111
additional[:user_agent_info] = user_agent_info
12-
rescue Gemcutter::UserAgentParser::UnableToParse => e
13-
Rails.error.report(e, context: { user_agent: }, handled: true)
12+
rescue Gemcutter::UserAgentParser::UnableToParse
13+
nil
1414
end
1515
end
1616

lib/gemcutter/user_agent_parser.rb

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def call(user_agent, exclusive: false)
3333

3434
return ret if ret
3535

36+
logger.warn("No parser could parse the user agent", user_agent: user_agent)
37+
3638
raise UnableToParse, "No parser could parse the user agent"
3739
end
3840
end

0 commit comments

Comments
 (0)