@@ -76,6 +76,14 @@ def callable_hook(index: int, config: VerificationConfig, state_data: Verificati
76
76
def callable_hook(verify_list: List[bool]): ...
77
77
```
78
78
79
+ === "on_plugin_not_found"
80
+ Hook that gets called when a plugin available in schema is not ready for usage/not implemented.
81
+ This case is possible for the plugins that are in Beta/development phase
82
+
83
+ ```python
84
+ def callable_hook(index:int, plugin_type: VerificationType): ...
85
+ ```
86
+
79
87
---
80
88
Each of the hooks get called on a certain event. The caller can register as many hooks for a particular event,
81
89
by calling the `register_hook(event_name, hook_method)` method. All the hooks are executed sequentially. The best example
@@ -86,6 +94,7 @@ def callable_hook(verify_list: List[bool]): ...
86
94
"on_start" ,
87
95
"on_each_plugin_start" ,
88
96
"on_each_plugin_end" ,
97
+ "on_plugin_not_found" ,
89
98
"on_end" ,
90
99
)
91
100
@@ -148,9 +157,17 @@ def execute(self) -> bool:
148
157
msg = f"Starting { verification_plugin .type .value } verification"
149
158
)
150
159
plugin_class = VERIFICATION_PLUGIN_MAP .get (
151
- verification_plugin .type .value
160
+ verification_plugin .type .value , None
152
161
)
153
- assert plugin_class is not None
162
+
163
+ if plugin_class is None :
164
+ # This can happen when a new plugin is not implemented yet, but is
165
+ # available in the schema
166
+ self .execute_hooks (
167
+ "on_plugin_not_found" , index , verification_plugin .type
168
+ )
169
+ continue
170
+
154
171
plugin = plugin_class (verification_plugin .config , data )
155
172
156
173
# Call all the hooks that were registered for `verification_plugin_start`.
0 commit comments