IMPROVEMENT: handle edge case where php callback returns known error, but didn't trigger well
This commit is contained in:
parent
248c7b3d77
commit
fe31a72a96
@ -46,7 +46,14 @@ $onUpdate_phpCode
|
|||||||
\$initial_data = json_encode(\$data);
|
\$initial_data = json_encode(\$data);
|
||||||
|
|
||||||
// Execute the dynamically generated function
|
// Execute the dynamically generated function
|
||||||
$functionName(\$data, \$error);
|
$error = "";
|
||||||
|
$retVal = $functionName(\$data, \$error);
|
||||||
|
|
||||||
|
// Handle errors
|
||||||
|
if ($retVal === false || !empty($error)) {
|
||||||
|
file_put_contents('php://stderr', "Error: $error\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
// Output the modified data as JSON
|
// Output the modified data as JSON
|
||||||
echo json_encode(\$data);
|
echo json_encode(\$data);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user