15295: Make "lock by different token" a PermissionDeniedError
[arvados.git] / services / api / app / models / container.rb
index 619abcc86e7437d749890a05c3618ed7f732a225..8999b3e14e123b78f8ecfaaa2ea821d8fa6e3490 100644 (file)
@@ -368,7 +368,7 @@ class Container < ArvadosModel
   def check_unlock
     if state_was == Locked and state == Queued
       if self.locked_by_uuid != current_api_client_authorization.uuid
-        raise InvalidStateTransitionError.new("locked by a different token")
+        raise ArvadosModel::PermissionDeniedError.new("locked by a different token")
       end
       if self.lock_count >= Rails.configuration.Containers.MaxDispatchAttempts
         self.state = Cancelled