+ rescue OSM::APIError => ex
+ render ex.render_opts
+ rescue ActiveRecord::RecordNotFound
+ render :nothing => true, :status => :not_found
+ end
+ end
+
+ # This is the API call to delete a way
+ def delete
+ begin
+ way = Way.find(params[:id])
+ way.delete_with_history(@user)
+
+ # if we get here, all is fine, otherwise something will catch below.
+ render :nothing => true
+ rescue OSM::APIError => ex
+ render ex.render_opts
+ rescue ActiveRecord::RecordNotFound
+ render :nothing => true, :status => :not_found
+ end
+ end