Permalink
Browse files

Pass parameters to APIAlreadyDeletedError correctly

  • Loading branch information...
1 parent c12fe5f commit 6279d83260cd9a03395a73f1c3df66ffe4c9486d @tomhughes committed Feb 5, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 app/controllers/notes_controller.rb
@@ -93,7 +93,7 @@ def comment
# Find the note and check it is valid
@note = Note.find(id)
raise OSM::APINotFoundError unless @note
- raise OSM::APIAlreadyDeletedError unless @note.visible?
+ raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible?
# Add a comment to the note
Note.transaction do
@@ -120,7 +120,7 @@ def close
# Find the note and check it is valid
@note = Note.find_by_id(id)
raise OSM::APINotFoundError unless @note
- raise OSM::APIAlreadyDeletedError unless @note.visible?
+ raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible?
# Close the note and add a comment
Note.transaction do
@@ -170,8 +170,8 @@ def show
# Find the note and check it is valid
@note = Note.find(params[:id])
raise OSM::APINotFoundError unless @note
- raise OSM::APIAlreadyDeletedError unless @note.visible?
-
+ raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible?
+
# Render the result
respond_to do |format|
format.xml
@@ -193,7 +193,7 @@ def destroy
# Find the note and check it is valid
note = Note.find(id)
raise OSM::APINotFoundError unless note
- raise OSM::APIAlreadyDeletedError unless note.visible?
+ raise OSM::APIAlreadyDeletedError.new("note", note.id) unless note.visible?
# Mark the note as hidden
Note.transaction do

0 comments on commit 6279d83

Please sign in to comment.