v1 server and lifecycle manager working. execution contract added
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
from core.runtime.outputs import buildOutput
|
||||
from core.execution.action.action import buildAction
|
||||
#from core.runtime.outputs import buildOutput
|
||||
|
||||
def manageFailure(error, action, outputs):
|
||||
if hasattr(action, "recoverPolicy"):
|
||||
errors = action.recoverPolicy
|
||||
error_type = type(error)
|
||||
|
||||
print(f"{type(error).__name__} detected during {action.name}. Applying recovery policy.")
|
||||
|
||||
if error_type in errors:
|
||||
repairs = errors[error_type]
|
||||
|
||||
for repair in repairs:
|
||||
outputs, response = buildAction(repair, outputs)
|
||||
|
||||
return outputs
|
||||
print(f"{error}")
|
||||
Reference in New Issue
Block a user