Re: Try/Catch
- Posted by dcuny Jan 09, 2015
- 5647 views
Time for Design by Contract? Sorry, just looking for a third way ... a road less traveled by.
I believe Programming by Contract solves a related, but different program. In the example you link to, if a contract fails in the example, Groovy throws an exception. So we're back to the question: How should an exception be handled?
As designed, Euphoria essentially throws an unrecoverable exception in many places - typically an indexing issue - where recovery is often possible.
This is good from a development point of view, in that it doesn't allow bugs to be masked.
Conversely, it's bad from a user point of view, in that users generally don't like to have their work interrupted with a crash.
My specific request is that Euphoria have a mechanism that allows for recovery from an exception - something much different from a crash_routine, which will exists on an exception.
- David