Closed harendra-kumar closed 5 years ago
Definitively yes. I missed some idiomatic way to tell the program: this process has finished, close all resources of this blocks since initFinish
. but this also must be done in case of an exception. So they collide.
An special Finish
exception may be called when the process finish normally and the resources are no longer needed. When whateverException
hit, the best practice in complex cases is throw finish >> throw watheverException
both. In simple cases, when no resources must be closed, finish is not needed.
The finish primitives are almost the same as the exception primitives. If we rename the
finish
primitive tothrowException
or equivalent we can just get rid or all other finish primitives and we get the ability to throw custom/user defined exceptions as well. With this, finish can just become a special exception type.