improve default connection for failure module

This commit is contained in:
Ruben Fiszel
2023-01-14 19:22:59 +01:00
parent 954cc1bb95
commit 279f671dcf
3 changed files with 7 additions and 4 deletions
@@ -382,6 +382,10 @@
export let fixedOverflowWidgets = true
export let fontSize = 16
if (typeof code != 'string') {
code = ''
}
const lang = 'template'
const dispatch = createEventDispatcher()
+1 -1
View File
@@ -92,7 +92,7 @@ export async function loadSchemaFromModule(module: FlowModule): Promise<{
if (JSON.stringify(keys.sort()) !== JSON.stringify(Object.keys(input_transforms).sort())) {
input_transforms = keys.reduce((accu, key) => {
let nv = input_transforms[key] ?? {
let nv = input_transforms[key] ?? (module.id == 'failure' && ['message', 'name'].includes(key)) ? { type: 'javascript', expr: `error.${key}` } : {
type: 'static',
value: undefined
}
+2 -3
View File
@@ -102,7 +102,7 @@ export async function main(x: string) {
}
`
export const DENO_FAILURE_MODULE_CODE = `
export const DENO_FAILURE_MODULE_CODE = `// flow is considered recovered and a success unless an exception is thrown
export async function main(message: string, name: string) {
const flow_id = Deno.env.get("WM_FLOW_JOB_ID")
@@ -119,8 +119,7 @@ def main(x: str):
`
export const PYTHON_FAILURE_MODULE_CODE = `import os
# connect the error parameter to 'previous_result.error'
# flow is considered recovered and a success unless an exception is raised
def main(message: str, name: str):
flow_id = os.environ.get("WM_FLOW_JOB_ID")