I ws looking at some code written by a consultant we hired for a special project. In the main processing function, the entire function is bracketed with a try/catch. At certain points, he throws a runtimeexception if something programmatically occurs such as an invalid parameter is passed in or sqlca.sqlcode <> 0. In other cases, he throws a descendant of n_exception.
In the catch block, when the runtimeexception is caught, he logs the properties on the exception such as the line number and the object name. I'm wondering if these properties are even set correctly, i.e., are they set just by throwing the object, or are they set when the object is contructed. Mind you, the runtimeexception object is created once during the constructor, not just before it is thrown.
I was under the impression that the runtime engine threw these, not the program itself. Is this an accepted practice?