streamlines exception types

This commit is contained in:
Shannon
2019-10-15 11:15:17 +11:00
parent dcc46fa32d
commit 37024664f5
2 changed files with 3 additions and 3 deletions

View File

@@ -263,7 +263,7 @@ where tbl.[name]=@0 and col.[name]=@1;", tableName, columnName)
db.Execute(@"SET LOCK_TIMEOUT 1800;");
var i = db.Execute(@"UPDATE umbracoLock WITH (REPEATABLEREAD) SET value = value*-1 WHERE id=@id", new { id = lockId });
if (i == 0) // ensure we are actually locking!
throw new InvalidOperationException($"LockObject with id={lockId} does not exist.");
throw new ArgumentException($"LockObject with id={lockId} does not exist.");
}
}