Merge pull request #455 from CanineHQ/chriszhu__clean_errors

clean up errors in sentry
This commit is contained in:
Chris Zhu
2025-12-13 06:16:35 +09:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -2,5 +2,6 @@ if ENV['SENTRY_DSN'].present?
Sentry.init do |config|
config.dsn = ENV['SENTRY_DSN']
config.breadcrumbs_logger = [ :active_support_logger, :http_logger ]
config.excluded_exceptions += [ 'ActionDispatch::RemoteIp::IpSpoofAttackError' ]
end
end

View File

@@ -79,7 +79,7 @@ module Portainer
end
rescue Socket::ResolutionError
raise ConnectionError, "Portainer URL is not resolvable"
rescue Net::ReadTimeout
rescue Net::ReadTimeout, Net::OpenTimeout
raise ConnectionError, "Connection to Portainer timed out"
end
@@ -131,7 +131,7 @@ module Portainer
end
rescue Socket::ResolutionError
raise ConnectionError, "Portainer URL is not resolvable"
rescue Net::ReadTimeout
rescue Net::ReadTimeout, Net::OpenTimeout
raise ConnectionError, "Connection to Portainer timed out"
end
@@ -141,7 +141,7 @@ module Portainer
end
rescue Socket::ResolutionError
raise ConnectionError, "Portainer URL is not resolvable"
rescue Net::ReadTimeout
rescue Net::ReadTimeout, Net::OpenTimeout
raise ConnectionError, "Connection to Portainer timed out"
end