erdantic.exceptions¶
ErdanticException
¶
Bases: Exception
Base class for all exceptions from erdantic library.
Source code in erdantic/exceptions.py
8 9 |
|
FieldNotFoundError
¶
Bases: AttributeError
, ErdanticException
Raised trying to access a field name that does not match any fields returned by the field extractor function for a model.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The name of the field that was not found. |
obj |
object
|
The model object that the field was being accessed on. |
model_full_name |
FullyQualifiedName
|
The fully qualified name of the model. |
Source code in erdantic/exceptions.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
ModelOrModuleNotFoundError
¶
Bases: ImportError
, ErdanticException
Raised when specified fully qualified name of model class or module cannot be imported.
Source code in erdantic/exceptions.py
25 26 |
|
PluginNotFoundError
¶
Bases: KeyError
, ErdanticException
Raised when specified plugin key does not match a registered plugin.
Attributes:
Name | Type | Description |
---|---|---|
key |
str
|
The plugin key that was not found. |
Source code in erdantic/exceptions.py
12 13 14 15 16 17 18 19 20 21 22 |
|
UnevaluatedForwardRefError
¶
Bases: ErdanticException
Raised when a field's type declaration has an unevaluated forward reference.
Attributes:
Name | Type | Description |
---|---|---|
model_full_name |
FullyQualifiedName
|
The fully qualified name of the model with the field with the unevaluated forward reference. |
field_name |
str
|
The name of the field with the unevaluated forward reference. |
forward_ref |
str
|
The string representation of the unevaluated forward reference. |
Source code in erdantic/exceptions.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
UnknownModelTypeError
¶
Bases: ValueError
, ErdanticException
Raised when a given model does not match known model types from loaded plugins.
Attributes:
Name | Type | Description |
---|---|---|
model |
type
|
The model class that was not recognized. |
available_plugins |
List[str]
|
List of plugin keys that were available. |
Source code in erdantic/exceptions.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
UnresolvableForwardRefError
¶
Bases: NameError
, ErdanticException
Raised when a forward reference in a type annotation cannot be resolved automatically.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
The string representation of the unresolvable forward reference. |
Source code in erdantic/exceptions.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|