Skip to content

Commit

Permalink
Rescue unexpected errors
Browse files Browse the repository at this point in the history
  • Loading branch information
imjoehaines committed Jan 23, 2024
1 parent 86808df commit 8660ddd
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/bugsnag/cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ def clean_url(url)

begin
uri = URI(url)

if uri.is_a?(URI::MailTo)
clean_mailto_url(url, uri)
else
clean_generic_url(url, uri)
end
rescue URI::InvalidURIError
pre_query_string, _query_string = url.split('?', 2)

return "#{pre_query_string}?#{FILTERED}"
end

if uri.is_a?(URI::MailTo)
clean_mailto_url(url, uri)
else
clean_generic_url(url, uri)
"#{pre_query_string}?#{FILTERED}"
rescue StandardError
FILTERED
end
end

Expand Down

0 comments on commit 8660ddd

Please sign in to comment.