Class ExpectedDataObjectNotFoundException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.opendaylight.yangtools.yang.common.OperationFailedException
-
- org.opendaylight.mdsal.common.api.ReadFailedException
-
- org.opendaylight.genius.datastoreutils.ExpectedDataObjectNotFoundException
-
- All Implemented Interfaces:
java.io.Serializable
public class ExpectedDataObjectNotFoundException extends org.opendaylight.mdsal.common.api.ReadFailedException
Exception thrown from code which expects data to necessarily be present in the data store.While this could be considered a functional problem instead of a technical error, and thus should not extend ReadFailedException (which is for technical errors), it does still for convenience of being able to propagate all ReadFailedException with a single "throws ReadFailedException" clause, instead of requiring you to declare "throws ExpectedDataObjectNotFoundException, ReadFailedException".
This is because any code which treats this as functional error and catches it is abusing the
SingleTransactionDataBroker.syncRead(DataBroker, LogicalDatastoreType, InstanceIdentifier)
method (the only one throwing this Exception), and should use another method: If code IS expecting data to not be found, then it should never use that method, but one of the alternatives in that class. If code is NEVER expecting data to not be found, then this is, effectively, a technical error (in that particular usage).- Author:
- Michael Vorburger
- See Also:
SingleTransactionDataBroker.syncRead(DataBroker, LogicalDatastoreType, InstanceIdentifier)
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ExpectedDataObjectNotFoundException(org.opendaylight.mdsal.common.api.LogicalDatastoreType datastoreType, org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path)
-
Method Summary
-
Methods inherited from class org.opendaylight.yangtools.yang.common.OperationFailedException
getErrorList, toString
-
-