Skip to content

Commit

Permalink
FIX: catch specific exception
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Aug 6, 2014
1 parent 9dc96d1 commit b573b32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/incoming_domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def self.add!(uri)

begin
current = create!(name: name, https: https, port: port)
rescue
rescue ActiveRecord::RecordNotUnique

This comment has been minimized.

Copy link
@eviltrout

eviltrout Aug 6, 2014

Contributor

Thanks :)

# duplicate key is just ignored
end

Expand Down
4 changes: 2 additions & 2 deletions app/models/incoming_referer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def self.add!(opts)

begin
current = create!(path: path, incoming_domain_id: domain_id)
rescue
# duplicates
rescue ActiveRecord::RecordNotUnique
# does not matter
end

current || find_by(path: path, incoming_domain_id: domain_id)
Expand Down

0 comments on commit b573b32

Please sign in to comment.