[AI] Prevent Throw Error step outside Try/Catch step

OS info

  • Operating System : Windows 10.0.26200
  • Wappler Version : 7.9.7

Problem description

Claude Sonnet 4.6 added the Throw Error step inside the Condition step which is not valid outside of the Try/Catch step.

Can you please provide some more details please?

Claude Sonnet generated an API where it used the Throw Error step instead of a Response step inside the Condition step which caused an error:

{
  "code": 0,
  "file": "www\\dmxConnectLib\\modules\\core.php",
  "line": 201,
  "message": "Testing...",
  "trace": "#0 www\\dmxConnectLib\\lib\\App.php(242): modules\\core-\u003Eerror(Object(stdClass), '', NULL)\n#1 www\\dmxConnectLib\\lib\\App.php(181): lib\\App-\u003EexecSteps(Object(stdClass))\n#2 www\\dmxConnectLib\\modules\\core.php(113): lib\\App-\u003Eexec(Object(stdClass), true)\n#3 www\\dmxConnectLib\\lib\\App.php(242): modules\\core-\u003Econdition(Object(stdClass), '', NULL)\n#4 www\\dmxConnectLib\\lib\\App.php(181): lib\\App-\u003EexecSteps(Object(stdClass))\n#5 www\\dmxConnectLib\\lib\\App.php(131): lib\\App-\u003Eexec(Object(stdClass), false)\n#6 www\\dmxConnect\\api\\foo.php(7): lib\\App-\u003Edefine(Object(stdClass))\n#7 {main}"
}