Index
frequenz.client.common ¤
Common code and utilities for Frequenz API clients.
Classes¤
frequenz.client.common.ClientCommonError ¤
frequenz.client.common.InvalidAttributeError ¤
Bases: ClientCommonError, ValueError
Raised when a semantic accessor sees an invalid value for a field.
This is also a ValueError for convenience.
Source code in src/frequenz/client/common/_exception.py
Attributes¤
attr_name
instance-attribute
¤
attr_name: str = attr_name
The name of the attribute that had an invalid value.
instance
instance-attribute
¤
instance: object = instance
The object instance that had an invalid value.
Methods:¤
__init__ ¤
Initialize this error.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The object instance that had an invalid value.
TYPE:
|
attr_name
|
The name of the attribute that had an invalid value.
TYPE:
|
message
|
A custom error message. If
TYPE:
|
Source code in src/frequenz/client/common/_exception.py
frequenz.client.common.MissingFieldError ¤
Bases: InvalidAttributeError
Raised when a semantic accessor sees a missing optional field.
This is used by accessors that resolve a wrapper field which may be
absent (typed as T | None or T | ... | None) to a concrete value,
when the underlying field was not set on the wire.
This is also a ValueError for convenience.
Source code in src/frequenz/client/common/_exception.py
Attributes¤
attr_name
instance-attribute
¤
attr_name: str = attr_name
The name of the attribute that had an invalid value.
instance
instance-attribute
¤
instance: object = instance
The object instance that had an invalid value.
Methods:¤
__init__ ¤
Initialize this error.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The object instance that was missing the field.
TYPE:
|
attr_name
|
The name of the missing field.
TYPE:
|
message
|
A custom error message. If
TYPE:
|
Source code in src/frequenz/client/common/_exception.py
frequenz.client.common.UnrecognizedEnumValueError ¤
Bases: InvalidAttributeError
Raised when a semantic accessor sees an unrecognized protobuf enum value.
This happens when the server sets an enum value that this version of the
client does not recognize, as opposed to an unspecified value (see
UnspecifiedEnumValueError). The raw
unrecognized value is available as value.
This is also a ValueError for convenience.
Source code in src/frequenz/client/common/_exception.py
Attributes¤
attr_name
instance-attribute
¤
attr_name: str = attr_name
The name of the attribute that had an invalid value.
instance
instance-attribute
¤
instance: object = instance
The object instance that had an invalid value.
Methods:¤
__init__ ¤
Initialize this error.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The object instance that had the unrecognized value.
TYPE:
|
attr_name
|
The name of the attribute that had the unrecognized value.
TYPE:
|
value
|
The raw protobuf value that was not recognized.
TYPE:
|
message
|
A custom error message. If
TYPE:
|
Source code in src/frequenz/client/common/_exception.py
frequenz.client.common.UnspecifiedEnumValueError ¤
Bases: InvalidAttributeError
Raised when a semantic accessor sees an unspecified protobuf enum value.
For a value that is set but not recognized by this client, see
UnrecognizedEnumValueError.
This is also a ValueError for convenience.
Source code in src/frequenz/client/common/_exception.py
Attributes¤
attr_name
instance-attribute
¤
attr_name: str = attr_name
The name of the attribute that had an invalid value.
instance
instance-attribute
¤
instance: object = instance
The object instance that had an invalid value.
Methods:¤
__init__ ¤
Initialize this error.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The object instance that had the unspecified value.
TYPE:
|
attr_name
|
The name of the attribute that had the unspecified value.
TYPE:
|
message
|
A custom error message. If
TYPE:
|