-
- when :put
- new_node = Node.from_xml(request.raw_post)
-
- if new_node
- node.timestamp = Time.now
- node.user_id = @user.id
-
- node.latitude = new_node.latitude
- node.longitude = new_node.longitude
- node.tags = new_node.tags
-
- if node.id == new_node.id and node.save_with_history
- render :nothing => true
- else
- render :nothing => true, :status => 500
- end
- else
- render :nothing => true, :status => 400 # if we got here the doc didnt parse
- end
- return
+ rescue ActiveRecord::RecordNotFound
+ render :nothing => true, :status => :not_found
+ rescue
+ render :nothing => true, :status => :internal_server_error