sob.errors
DefinitionExistsError
Bases: Exception
This error is raised when an attempt is made to redefine a singleton class instance.
ValidationError
Bases: Exception
This error is raised when sob.validate
encounters extraneous attributes
associated with a model instance, or discovers missing required attributes.
VersionError
Bases: AttributeError
This error is raised when versioning an object fails due to having data which is incompatible with the target version.
DeserializeError
DeserializeError(data: str, message: str = '')
Bases: ValueError
This error is raised when data is encountered during deserialization which cannot be parsed.
Attributes:
-
data
(str
) –The data that could not be parsed.
-
message
(str
) –Additional information about the error.
Parameters:
-
data
(str
) –The data that could not be parsed.
-
message
(str
, default:''
) –An optional message to include with the error.
Source code in sob/errors.py
51 52 53 54 55 56 57 58 59 |
|
UnmarshalError
UnmarshalError(
message: str | None = None,
data: sob.abc.MarshallableTypes | None = None,
types: (
collections.abc.Iterable[sob.abc.Property | type]
| sob.abc.Types
| None
) = None,
item_types: (
collections.abc.Iterable[sob.abc.Property | type]
| sob.abc.Types
| None
) = None,
value_types: (
collections.abc.Iterable[sob.abc.Property | type]
| sob.abc.Types
| None
) = None,
)
Bases: Exception
This is an error message raised when data cannot be un-marshalled due to not matching metadata specs.
Attributes:
-
message
– -
parameter
–
Source code in sob/errors.py
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
get_exception_text
get_exception_text() -> str
When called within an exception, this function returns a text
representation of the error matching what is found in
traceback.print_exception
, but is returned as a string value rather than
printing.
Source code in sob/errors.py
130 131 132 133 134 135 136 137 |
|
append_exception_text
append_exception_text(
error: Exception, message: str
) -> None
Cause message
to be appended to an error's exception text.
Source code in sob/errors.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
|