public class ExpectedDataObjectNotFoundException
extends org.opendaylight.controller.md.sal.common.api.data.ReadFailedException
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).
SingleTransactionDataBroker.syncRead(DataBroker, LogicalDatastoreType, InstanceIdentifier)
,
Serialized FormConstructor and Description |
---|
ExpectedDataObjectNotFoundException(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType datastoreType,
org.opendaylight.yangtools.yang.binding.InstanceIdentifier<T> path) |
getErrorList, toString
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
Copyright © 2019 OpenDaylight. All rights reserved.