confit.errors
MissingReference
Bases: Exception
Raised when one or multiple references cannot be resolved.
Source code in confit/errors.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
__init__(ref)
PARAMETER | DESCRIPTION |
---|---|
ref |
The reference that could not be resolved.
TYPE:
|
Source code in confit/errors.py
39 40 41 42 43 44 45 46 47 |
|
__str__()
String representation of the exception
Source code in confit/errors.py
49 50 51 52 53 |
|
CyclicReferenceError
Bases: Exception
Raised when a cyclic reference is detected.
Source code in confit/errors.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
__init__(path)
PARAMETER | DESCRIPTION |
---|---|
path |
The path of the cyclic reference
TYPE:
|
Source code in confit/errors.py
61 62 63 64 65 66 67 68 69 |
|
__str__()
String representation of the exception
Source code in confit/errors.py
71 72 73 74 75 |
|
remove_lib_from_traceback(tb)
Remove the lib folder from the traceback
Source code in confit/errors.py
81 82 83 84 85 86 87 88 89 90 91 92 93 |
|
to_legacy_error(err, model)
Decorator to convert a Pydantic ValidationError into a ConfitValidationError
Source code in confit/errors.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
patch_errors(errors, path=(), values=None, model=None, special_names=(), drop_names=())
Patch the location of the errors to add the path
prefix and complete
the errors with the actual value if it is available.
This is useful when the errors are raised in a sub-dict of the config.
PARAMETER | DESCRIPTION |
---|---|
errors |
The pydantic errors to patch
TYPE:
|
path |
The path to add to the errors
TYPE:
|
values |
The values of the config
TYPE:
|
special_names |
The names of the special keys of the model signature, to replace with a wildcard when encountered in the error path
TYPE:
|
model |
The model of the config
TYPE:
|
drop_names |
The names of the keys to drop from the error path
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Union[ValidationError, Sequence[ErrorWrapper], ErrorWrapper]
|
The patched errors |
Source code in confit/errors.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
|