Re: Try/Catch
- Posted by Spock Jan 13, 2015
- 5209 views
jimcbrown said...
Spock said...
However, an exceptable situation already has a check inside the internal routine which, in the suggested scheme of things, will default to a 'safe' behaviour instead of crashing. That doesn't solve the program error in the first place but it can alert us to the fact.
How? How does it alert us to the fact that the situation occurred?
Because the internal routine responsible instead of calling FatalError (or whatever it is) would emit a console message and return a default value (in the case of a function). As mentioned in an earlier post, a more sophisticated approach could be to also record the error in a log file to be sent to the developer, perhaps by way of a user-defined routine.
Spock