Merge branch '2873-permission-links-ownership'
[arvados.git] / services / api / app / controllers / arvados / v1 / links_controller.rb
index 722afd13a977fe6b603c71bff11a20e1ff74a11c..f76af60bb93503a3908d48afae6609ff593e9414 100644 (file)
@@ -2,7 +2,8 @@ class Arvados::V1::LinksController < ApplicationController
 
   def check_uuid_kind uuid, kind
     if kind and ArvadosModel::resource_class_for_uuid(uuid).andand.kind != kind
-      render :json => { errors: ["'#{kind}' does not match uuid '#{uuid}', expected '#{ArvadosModel::resource_class_for_uuid(uuid).andand.kind}'"] }.to_json, status: 422
+      send_error("'#{kind}' does not match uuid '#{uuid}', expected '#{ArvadosModel::resource_class_for_uuid(uuid).andand.kind}'",
+                 status: 422)
       nil
     else
       true