mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 16:03:47 +00:00
improve default connection for failure module
This commit is contained in:
@@ -382,6 +382,10 @@
|
||||
export let fixedOverflowWidgets = true
|
||||
export let fontSize = 16
|
||||
|
||||
if (typeof code != 'string') {
|
||||
code = ''
|
||||
}
|
||||
|
||||
const lang = 'template'
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user