diff --git a/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java b/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java index 633c6a6ad5..d1e97e221e 100644 --- a/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java +++ b/source/java/org/alfresco/opencmis/AlfrescoCmisServiceImpl.java @@ -1769,10 +1769,17 @@ public class AlfrescoCmisServiceImpl extends AbstractCmisService implements Alfr CMISNodeInfo info = getOrCreateNodeInfo(objectId.getValue(), "Object"); - // check for current version - if (!info.isVariant(CMISObjectVariant.CURRENT_VERSION)) + // Check for current version + if (info.isVariant(CMISObjectVariant.CURRENT_VERSION)) { - throw new CmisInvalidArgumentException("Only documents can be checked out!"); + // Good + } + else if (info.isVariant(CMISObjectVariant.VERSION)) + { + throw new CmisInvalidArgumentException("Can't check out an old version of a document"); + } + else { + throw new CmisInvalidArgumentException("Only documents can be checked out! Object was a " + info.getObjectVariant().toString()); } // get object