Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java =================================================================== --- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java (revision 1179148) +++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java (working copy) @@ -121,7 +121,7 @@ try { return (InternalFrozenNode) vMgr.getItem(getFrozenNodeId()); } catch (RepositoryException e) { - throw new IllegalStateException("unable to retrieve frozen node: " + e); + throw new InconsistentVersioningState("unable to retrieve frozen node: " + e, e); } } @@ -131,7 +131,7 @@ public NodeId getFrozenNodeId() { ChildNodeEntry entry = node.getState().getChildNodeEntry(NameConstants.JCR_FROZENNODE, 1); if (entry == null) { - throw new InternalError("version has no frozen node: " + getId()); + throw new InconsistentVersioningState("version has no frozen node: " + getId()); } return entry.getId(); } Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InconsistentVersioningState.java =================================================================== --- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InconsistentVersioningState.java (revision 0) +++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InconsistentVersioningState.java (revision 0) @@ -0,0 +1,49 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.jackrabbit.core.version; + +/** + * The InconsistentVersionControlState is used to signal + * inconsistencies in the versioning related state of a node, such + * as missing mandatory properties, missing version nodes, etc. + */ +public class InconsistentVersioningState extends RuntimeException { + + /** + * Constructs a new instance of this class with the specified detail + * message. + * + * @param message the detail message. The detail message is saved for + * later retrieval by the {@link #getMessage()} method. + */ + public InconsistentVersioningState(String message) { + super(message); + } + + /** + * Constructs a new instance of this class with the specified detail + * message and root cause. + * + * @param message the detail message. The detail message is saved for + * later retrieval by the {@link #getMessage()} method. + * @param rootCause root failure cause + */ + public InconsistentVersioningState(String message, Throwable rootCause) { + super(message, rootCause); + } + +} Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java =================================================================== --- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java (revision 1179148) +++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java (working copy) @@ -238,7 +238,7 @@ v = new InternalVersionImpl(this, child, child.getName()); } } catch (RepositoryException e) { - throw new InternalError("Version does not have a jcr:frozenNode: " + child.getNodeId()); + throw new InconsistentVersioningState("Version does not have a jcr:frozenNode: " + child.getNodeId(), e); } } return v;