Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
How can I elegantly trigger an error in the script when a condition is not met?
I do not want to exit the script without an error because then I would not get a warning in the Publisher...
,KR Koen
My solution:
IF condition then
TRACE( Condition is not valid);
SET TriggerError; //This line of code triggers an error
END IF
My preferred technique: use the CRASH; statement. It doesn't exist but it will do what it says... ![]()
Maybe something like this:
if condition = false() then
Load * Resident NotExistingTable;
end if
- Marcus
Hi,
IF Condition Not met,
trace 'This condition has not been met!';
Exit script;
else
Continue
Mark
You can use any word that is not a command
If 1 <> 0 then
Die!
endif ;
Will work but not the most elegant one ![]()
Thanks for the feedback. But this will not trigger an error in my mgmt console.
Will it find the endif statement?
My solution:
IF condition then
TRACE( Condition is not valid);
SET TriggerError; //This line of code triggers an error
END IF
That is genial!