Skip to content

Commit

Permalink
rescue from ActiveRecord::ConnectionNotEstablished (#372)
Browse files Browse the repository at this point in the history
Co-authored-by: Judah Meek <[email protected]>
  • Loading branch information
gblair and Judahmeek authored Jul 17, 2022
1 parent 73978cf commit 001c3f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/public_activity/orm/active_record/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ConnectionError < Exception; end
end
end
end

module ORM
module ActiveRecord
# The ActiveRecord model containing
Expand Down Expand Up @@ -53,6 +53,8 @@ class Activity < ::ActiveRecord::Base
end
rescue ::ActiveRecord::NoDatabaseError
warn("[WARN] database doesn't exist. Skipping PublicActivity::Activity#parameters's serialization")
rescue ::ActiveRecord::ConnectionNotEstablished
warn("[WARN] couldn't connect to database. Skipping PublicActivity::Activity#parameters's serialization")
rescue ::PG::ConnectionBad
warn("[WARN] couldn't connect to database. Skipping PublicActivity::Activity#parameters's serialization")
rescue Mysql2::Error::ConnectionError
Expand Down

0 comments on commit 001c3f7

Please sign in to comment.