Exceptions
Exceptions used by the Yangson library.
This module defines the following exceptions:
AnnotationException: Base class for exceptions related to metadata annotations.BadSchemaNodeType: A schema node is of a wrong type.BadYangLibraryData: Invalid YANG library data.CyclicImports: Imports of YANG modules form a cycle.DefinitionNotFound: Requested definition does not exist.EndOfInput: Unexpected end of input.FeaturePrerequisiteError: Pre-requisite feature isn’t supported.InstanceException: Base class for exceptions related to operations on instance nodes.InstanceValueError: The instance value is incompatible with the called method.InvalidArgument: Invalid argument of a statement.InvalidFeatureExpression: Invalid if-feature expression.InvalidKeyValue: Invalid list key or leaf-list value.InvalidLeafrefPath: A leafref path is incorrect.InvalidSchemaPath: Invalid schema pathInvalidXPath: An XPath expression is invalid.MissingAnnotationTarget: Instance node that is being annotated doesn’t exist.MissingModule: Abstract exception class – a module is missing.ModuleContentMismatch: Abstract exception class – unexpected module name or revision.ModuleNameMismatch: The module name doesn’t match the expected name.ModuleNotFound: A module not found.ModuleRevisionMismatch: The module revision doesn’t match the expected revision.ModuleNotImplemented: A module is not implemented in the data model.ModuleNotImported: A module is not imported.ModuleNotRegistered: An imported module is not registered in YANG library.MultipleImplementedRevisions: A module has multiple implemented revisions.NonexistentInstance: Attempt to access an instance node that doesn’t exist.NonDataNode: Attempt to access an instance of non-data node (rpc/action/notification).NonexistentSchemaNode: A schema node doesn’t exist.NotSupported: A given XPath 1.0 feature isn’t (currently) supported.ParserException: Base class for parser exceptions.RawDataError: Abstract exception class for errors in raw data.RawMemberError: Object member in raw data doesn’t exist in the schema.RawTypeError: Raw data value is of incorrect type.SchemaError: An instance violates a schema constraint.SchemaNodeException: Abstract exception class for schema node errors.SemanticError: An instance violates a semantic rule.StatementNotFound: Required statement does not exist.UndefinedAnnotation: Undefined annotation is used.UnexpectedInput: Unexpected input.UnknownPrefix: Unknown namespace prefix.ValidationError: Abstract exception class for instance validation errors.XPathTypeError: A subexpression is of a wrong type.YangsonException: Base class for all Yangson exceptions.YangTypeError: A scalar value is of incorrect type.
- exception yangson.exceptions.AnnotationException(path: str)
Bases:
YangsonExceptionAbstract class for exceptions related to metadata annotations.
- exception yangson.exceptions.AnnotationTypeError(path: str, aname: str, msg: str)
Bases:
AnnotationExceptionType of annotation is incorrect.
- exception yangson.exceptions.BadSchemaNodeType(qn: tuple[str, str], expected: str)
Bases:
SchemaNodeExceptionA schema node is of a wrong type.
- exception yangson.exceptions.BadYangLibraryData(message: str)
Bases:
YangsonExceptionBroken YANG library data.
- exception yangson.exceptions.CyclicImports
Bases:
YangsonExceptionYANG modules are imported in a cyclic fashion.
- exception yangson.exceptions.DefinitionNotFound(kw: str, name: str)
Bases:
YangsonExceptionRequested definition does not exist.
- exception yangson.exceptions.EndOfInput(parser: Parser)
Bases:
ParserExceptionUnexpected end of input.
- exception yangson.exceptions.FeaturePrerequisiteError(name: str, ns: str)
Bases:
YangsonExceptionPre-requisite feature is not supported.
- exception yangson.exceptions.InstanceException(instance: InstanceNode, message: str)
Bases:
YangsonExceptionAbstract class for exceptions related to operations on instance nodes.
- exception yangson.exceptions.InstanceValueError(instance: InstanceNode, message: str)
Bases:
InstanceExceptionThe instance value is incompatible with the called method.
- exception yangson.exceptions.InvalidArgument(arg: str)
Bases:
YangsonExceptionThe argument of a statement is invalid.
- exception yangson.exceptions.InvalidFeatureExpression(parser: Parser)
Bases:
ParserExceptionInvalid if-feature expression.
- exception yangson.exceptions.InvalidKeyValue(value: int | Decimal | str | tuple[None])
Bases:
YangsonExceptionList key or leaf-list value is invalid.
- exception yangson.exceptions.InvalidLeafrefPath(qn: tuple[str, str])
Bases:
SchemaNodeExceptionA leafref path is incorrect.
- exception yangson.exceptions.InvalidSchemaPath(path: str)
Bases:
YangsonExceptionInvalid schema or data path.
- exception yangson.exceptions.InvalidXPath(parser: Parser)
Bases:
ParserExceptionException to be raised for an invalid XPath expression.
- exception yangson.exceptions.MissingAnnotationTarget(path: str, iname: str)
Bases:
AnnotationExceptionInstance node that is being annotated doesn’t exist.
- exception yangson.exceptions.MissingModule(name: str, rev: str = '')
Bases:
YangsonExceptionAbstract exception class – a module is missing.
- exception yangson.exceptions.MissingModuleNamespace(ns: str)
Bases:
YangsonExceptionAbstract exception class – a module is missing.
- exception yangson.exceptions.ModuleContentMismatch(found: str, expected: str)
Bases:
YangsonExceptionAbstract exception class – unexpected module name or revision.
- exception yangson.exceptions.ModuleNameMismatch(found: str, expected: str)
Bases:
ModuleContentMismatchParsed module revision doesn’t match the expected revision.
- exception yangson.exceptions.ModuleNotFound(name: str, rev: str = '')
Bases:
MissingModuleA module or submodule registered in YANG library is not found.
- exception yangson.exceptions.ModuleNotImplemented(name: str, rev: str = '')
Bases:
MissingModuleA module is not implemented in the data model.
- exception yangson.exceptions.ModuleNotImported(mod: str, mid: tuple[str, str])
Bases:
YangsonExceptionModule is not imported.
- exception yangson.exceptions.ModuleNotRegistered(name: str, rev: str = '')
Bases:
MissingModuleA module is not registered in YANG library.
- exception yangson.exceptions.ModuleRevisionMismatch(found: str, expected: str)
Bases:
ModuleContentMismatchParsed module revision doesn’t match the expected revision.
- exception yangson.exceptions.MultipleImplementedRevisions(module: str)
Bases:
YangsonExceptionA module has multiple implemented revisions.
- exception yangson.exceptions.NonDataNode(instance: InstanceNode, message: str)
Bases:
InstanceExceptionAttempt to access an instance of non-data node (rpc/action/notification).
- exception yangson.exceptions.NonexistentInstance(instance: InstanceNode, message: str)
Bases:
InstanceExceptionAttempt to access an instance node that doesn’t exist.
- exception yangson.exceptions.NonexistentSchemaNode(qn: tuple[str, str], name: str, ns: str = None)
Bases:
SchemaNodeExceptionA schema node doesn’t exist as a child of
qn.
- exception yangson.exceptions.NotSupported(parser: Parser, feature: str)
Bases:
ParserExceptionException to be raised for unimplemented XPath features.
- exception yangson.exceptions.ParserException(parser: Parser)
Bases:
YangsonExceptionBase class for parser exceptions.
- exception yangson.exceptions.RawDataError(path: str)
Bases:
YangsonExceptionAbstract exception class for errors in raw data.
- exception yangson.exceptions.RawMemberError(path: str)
Bases:
RawDataErrorObject member in the raw value doesn’t exist in the schema.
- exception yangson.exceptions.RawTypeError(path: str, expected: str)
Bases:
RawDataErrorRaw value is of an incorrect type.
- exception yangson.exceptions.SchemaError(instance: InstanceNode, tag: str, message: str = None)
Bases:
ValidationErrorAn instance violates a schema constraint.
- exception yangson.exceptions.SchemaNodeException(qn: tuple[str, str])
Bases:
YangsonExceptionAbstract exception class for schema node errors.
- exception yangson.exceptions.SemanticError(instance: InstanceNode, tag: str, message: str = None)
Bases:
ValidationErrorAn instance violates a semantic rule.
- exception yangson.exceptions.StatementNotFound(parent: str, kw: str)
Bases:
YangsonExceptionRequired statement does not exist.
- exception yangson.exceptions.UndefinedAnnotation(path: str, aname: str)
Bases:
AnnotationExceptionUndefined annotation is used.
- exception yangson.exceptions.UnexpectedInput(parser: Parser, expected: str = None)
Bases:
ParserExceptionUnexpected input.
- exception yangson.exceptions.UnknownPrefix(prefix: str, mid: tuple[str, str])
Bases:
YangsonExceptionUnknown namespace prefix.
- exception yangson.exceptions.ValidationError(instance: InstanceNode, tag: str, message: str = None)
Bases:
YangsonExceptionAbstract exception class for instance validation errors.
- exception yangson.exceptions.XPathTypeError(value: str)
Bases:
YangsonExceptionThe value of an XPath (sub)expression is of a wrong type.
- exception yangson.exceptions.YangTypeError(instance: InstanceNode, tag: str, message: str = None)
Bases:
ValidationErrorA scalar value doesn’t match its expected type.