I am wondering if there is a variable that I can check at the bottom of my stored process code to verify if the stored process completed successfully.
(Just as background information: There is currently a bug in the portal that, if you run a stored process that errors out, the portal does not return the error log but gives a bizarre error 'Wraps an exception thrown while using the hints provided to bind to the Result Package.' because there is no output data for the results package to bind to. The Stored Process group in Tech support is aware of the issue and there is currently no fix available.) In my case, the error is generated when the user inputs parameter values that cause the code to be invalid.
That being said, I want to check the error status of the STP at the end of the code so that, if there is an error, I can generate output - a meaningful message that tells the user that the values they entered are invalid.
I have tried syserr and _error_ but these are only valid for a given step not the entire STP, which would mean I'd have to add a check after every data/proc step in every STP, which is not a practical option.
The Stored Process folks in Tech Support are the best folks to answer this question. Unless there's something buried in the Administration guide on this, I only know of ways to check steps.
In your position I would step back to the parameters and examine these.
Is there some way you can test each parameter is "in scope" and terminate the stored process in a more controlled manner?
"Causes the code to be invalid" suggests you might have character values where numeric are needed, or vice versa, or incorrectly quoted lists, values outside allowable ranges etc. Each of these can be checked and flags set if they fail validation.
IMHO, it is poor design to create a processing object that may be sent invalid data by users, and not perform some degree of validation or constraint. As it stands, even when the bug is fixed, you will still have a process failure and a report that is not very helpful to diagnose the cause.