Using try-catch for SQLExec in App Engine peoplecode
Hello - I am trying to handle the fatal SQL Error caused by SQLExec, by wrapping it in try-catch.
In my test case below, I am inserting a value that already exists in my table, and hence a unique constraint should occur as error.
Here is my sample code block (and the test app engine for this, as just one section-one step and one action (PC)).
try
SQLExec("INSERT INTO PS_XX_TEST VALUES ('Test')");
catch Exception &ex
/* Display messages in process Monitor Log */
MessageBox(0, "", 21000, 100, "", &ex.ToString());
MessageBox(0, "", 21000, 100, "", "Exceptions found ! Check details in log file ");
Exit (0);
end-try;
Since I am exiting as 0, so, there is a zero return, hence the AE should not abend. Still it abends.