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:
YangsonException
Abstract class for exceptions related to metadata annotations.
- exception yangson.exceptions.AnnotationTypeError(path: str, aname: str, msg: str)
Bases:
AnnotationException
Type of annotation is incorrect.
- exception yangson.exceptions.BadSchemaNodeType(qn: tuple[str, str], expected: str)
Bases:
SchemaNodeException
A schema node is of a wrong type.
- exception yangson.exceptions.BadYangLibraryData(message: str)
Bases:
YangsonException
Broken YANG library data.
- exception yangson.exceptions.CyclicImports
Bases:
YangsonException
YANG modules are imported in a cyclic fashion.
- exception yangson.exceptions.DefinitionNotFound(kw: str, name: str)
Bases:
YangsonException
Requested definition does not exist.
- exception yangson.exceptions.EndOfInput(parser: Parser)
Bases:
ParserException
Unexpected end of input.
- exception yangson.exceptions.FeaturePrerequisiteError(name: str, ns: str)
Bases:
YangsonException
Pre-requisite feature is not supported.
- exception yangson.exceptions.InstanceException(instance: InstanceNode, message: str)
Bases:
YangsonException
Abstract class for exceptions related to operations on instance nodes.
- exception yangson.exceptions.InstanceValueError(instance: InstanceNode, message: str)
Bases:
InstanceException
The instance value is incompatible with the called method.
- exception yangson.exceptions.InvalidArgument(arg: str)
Bases:
YangsonException
The argument of a statement is invalid.
- exception yangson.exceptions.InvalidFeatureExpression(parser: Parser)
Bases:
ParserException
Invalid if-feature expression.
- exception yangson.exceptions.InvalidKeyValue(value: int | Decimal | str | tuple[None])
Bases:
YangsonException
List key or leaf-list value is invalid.
- exception yangson.exceptions.InvalidLeafrefPath(qn: tuple[str, str])
Bases:
SchemaNodeException
A leafref path is incorrect.
- exception yangson.exceptions.InvalidSchemaPath(path: str)
Bases:
YangsonException
Invalid schema or data path.
- exception yangson.exceptions.InvalidXPath(parser: Parser)
Bases:
ParserException
Exception to be raised for an invalid XPath expression.
- exception yangson.exceptions.MissingAnnotationTarget(path: str, iname: str)
Bases:
AnnotationException
Instance node that is being annotated doesn’t exist.
- exception yangson.exceptions.MissingModule(name: str, rev: str = '')
Bases:
YangsonException
Abstract exception class – a module is missing.
- exception yangson.exceptions.MissingModuleNamespace(ns: str)
Bases:
YangsonException
Abstract exception class – a module is missing.
- exception yangson.exceptions.ModuleContentMismatch(found: str, expected: str)
Bases:
YangsonException
Abstract exception class – unexpected module name or revision.
- exception yangson.exceptions.ModuleNameMismatch(found: str, expected: str)
Bases:
ModuleContentMismatch
Parsed module revision doesn’t match the expected revision.
- exception yangson.exceptions.ModuleNotFound(name: str, rev: str = '')
Bases:
MissingModule
A module or submodule registered in YANG library is not found.
- exception yangson.exceptions.ModuleNotImplemented(name: str, rev: str = '')
Bases:
MissingModule
A module is not implemented in the data model.
- exception yangson.exceptions.ModuleNotImported(mod: str, mid: tuple[str, str])
Bases:
YangsonException
Module is not imported.
- exception yangson.exceptions.ModuleNotRegistered(name: str, rev: str = '')
Bases:
MissingModule
A module is not registered in YANG library.
- exception yangson.exceptions.ModuleRevisionMismatch(found: str, expected: str)
Bases:
ModuleContentMismatch
Parsed module revision doesn’t match the expected revision.
- exception yangson.exceptions.MultipleImplementedRevisions(module: str)
Bases:
YangsonException
A module has multiple implemented revisions.
- exception yangson.exceptions.NonDataNode(instance: InstanceNode, message: str)
Bases:
InstanceException
Attempt to access an instance of non-data node (rpc/action/notification).
- exception yangson.exceptions.NonexistentInstance(instance: InstanceNode, message: str)
Bases:
InstanceException
Attempt to access an instance node that doesn’t exist.
- exception yangson.exceptions.NonexistentSchemaNode(qn: tuple[str, str], name: str, ns: str = None)
Bases:
SchemaNodeException
A schema node doesn’t exist.
- exception yangson.exceptions.NotSupported(parser: Parser, feature: str)
Bases:
ParserException
Exception to be raised for unimplemented XPath features.
- exception yangson.exceptions.ParserException(parser: Parser)
Bases:
YangsonException
Base class for parser exceptions.
- exception yangson.exceptions.RawDataError(path: str)
Bases:
YangsonException
Abstract exception class for errors in raw data.
- exception yangson.exceptions.RawMemberError(path: str)
Bases:
RawDataError
Object member in the raw value doesn’t exist in the schema.
- exception yangson.exceptions.RawTypeError(path: str, expected: str)
Bases:
RawDataError
Raw value is of an incorrect type.
- exception yangson.exceptions.SchemaError(instance: InstanceNode, tag: str, message: str = None)
Bases:
ValidationError
An instance violates a schema constraint.
- exception yangson.exceptions.SchemaNodeException(qn: tuple[str, str])
Bases:
YangsonException
Abstract exception class for schema node errors.
- exception yangson.exceptions.SemanticError(instance: InstanceNode, tag: str, message: str = None)
Bases:
ValidationError
An instance violates a semantic rule.
- exception yangson.exceptions.StatementNotFound(parent: str, kw: str)
Bases:
YangsonException
Required statement does not exist.
- exception yangson.exceptions.UndefinedAnnotation(path: str, aname: str)
Bases:
AnnotationException
Undefined annotation is used.
- exception yangson.exceptions.UnexpectedInput(parser: Parser, expected: str = None)
Bases:
ParserException
Unexpected input.
- exception yangson.exceptions.UnknownPrefix(prefix: str, mid: tuple[str, str])
Bases:
YangsonException
Unknown namespace prefix.
- exception yangson.exceptions.ValidationError(instance: InstanceNode, tag: str, message: str = None)
Bases:
YangsonException
Abstract exception class for instance validation errors.
- exception yangson.exceptions.XPathTypeError(value: str)
Bases:
YangsonException
The value of an XPath (sub)expression is of a wrong type.
- exception yangson.exceptions.YangTypeError(instance: InstanceNode, tag: str, message: str = None)
Bases:
ValidationError
A scalar value doesn’t match its expected type.