mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: catch specific exception
This commit is contained in:
@@ -11,7 +11,7 @@ class IncomingDomain < ActiveRecord::Base
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
current = create!(name: name, https: https, port: port)
|
current = create!(name: name, https: https, port: port)
|
||||||
rescue
|
rescue ActiveRecord::RecordNotUnique
|
||||||
# duplicate key is just ignored
|
# duplicate key is just ignored
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ class IncomingReferer < ActiveRecord::Base
|
|||||||
|
|
||||||
begin
|
begin
|
||||||
current = create!(path: path, incoming_domain_id: domain_id)
|
current = create!(path: path, incoming_domain_id: domain_id)
|
||||||
rescue
|
rescue ActiveRecord::RecordNotUnique
|
||||||
# duplicates
|
# does not matter
|
||||||
end
|
end
|
||||||
|
|
||||||
current || find_by(path: path, incoming_domain_id: domain_id)
|
current || find_by(path: path, incoming_domain_id: domain_id)
|
||||||
|
|||||||
Reference in New Issue
Block a user