@Rub21 commented on this pull request.
> @@ -12,6 +12,10 @@ class ApplicationController < ActionController::Base
rescue_from RailsParam::InvalidParameterError, :with => :invalid_parameter
+ rescue_from ActiveRecord::ConnectionNotEstablished,
+ ActiveRecord::DatabaseConnectionError,
+ ActiveRecord::NoDatabaseError, :with => :gps_database_unavailable
+
Yes, you are right, the current rescue_from catches the error for the two
databases, not only GPS.
I added this rescue to protect the main site when the GPS DB is unavailable. In
https://github.com/openstreetmap/chef/pull/846#discussion_r3170850209, I set a
short connect_timeout for it, so the connection fails fast and the request does
not hang. That way if a user opens /traces while the GPS DB is unavailable, we
show a warning instead of blocking the process.
I updated the gps_database_unavailable method so it only handles GPS errors;
otherwise it re-raises the exception.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7111#discussion_r3325915917
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/7111/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev