diff --git a/src/lib/stores/schedules.ts b/src/lib/stores/schedules.ts index 6fa0a1b5f..9645dfd17 100644 --- a/src/lib/stores/schedules.ts +++ b/src/lib/stores/schedules.ts @@ -207,13 +207,18 @@ export const submitEditSchedule = async ( const fields = body.schedule.action.startWorkflow?.header?.fields; if (fields && Object.keys(fields).length > 0) { - const entries = Object.entries(fields); - for (const [key, value] of entries) { - const encodedValue = await encodePayloads( - stringifyWithBigInt(value), - 'json/plain', - ); - fields[key] = encodedValue[0]; + try { + const entries = Object.entries(fields); + for (const [key, value] of entries) { + const encodedValue = await encodePayloads( + stringifyWithBigInt(value), + 'json/plain', + ); + fields[key] = encodedValue[0]; + } + } catch (e) { + error.set(`${translate('data-encoder.encode-error')}: ${e?.message}`); + return; } }