What I mean strict mode is, fail the node in some situation(like waring …).
e.g.:
Like Math Formula, you can divide by 0 in this node, and get the missing value as result.(And without any warning!)
But sometimes I do not what the missing value, I just want the node to be failed. Then I can use try ... catch structure to wrap the node and do something …
It seems at this time, I can use Java related nodes only? Writing some throw new Abort(....) code?
Do we have some better solution about this common problem?
Hi @HaveF , not sure if there are “better” solution, but as an alternative if you don’t want to use Java, you can always either check the denominator value before the Math Formula, or check for missing values after the Math Formula and take the appropriate action.
And if the appropriate action if to stop the workflow, you can force your workflow to fail with the Fail in execution node:
for example given I would probably use if() function inside Math Formula node to check denominator for 0 and then take appropriate action either check the denominator value before the Math Formula node as suggested by @bruno29a.
Believe catching warnings (when there are ones) with Try/Catch nodes could be one approach. Added +1 to existing ticket. (Internal reference: AP-14264)
Hey @ipazin , I think it would be more about switching from warning to an error/fail rather than catching warnings. In theory, you can’t catch warnings as they’re not exceptions.
With the strict approach, a division by zero would be evaluated and should fail, that’s where the try/catch would then be able to catch it.