Per review, don't use one line rescue

One line rescue will rescue any exception and doesn't allow for rescuing
specific exception: https://thoughtbot.com/blog/don-t-inline-rescue-in-ruby
This commit is contained in:
Gaetan Craig-Riou
2025-11-24 13:47:32 +11:00
parent bb0903cd4a
commit 6ae47c208a

View File

@@ -78,4 +78,8 @@ Flipper::UI.configure do |config|
end
# Add known feature toggles. This may fail if the database isn't setup yet.
OpenFoodNetwork::FeatureToggle.setup! rescue ActiveRecord::StatementInvalid
begin
OpenFoodNetwork::FeatureToggle.setup!
rescue ActiveRecord::StatementInvalid
nil
end