Comment by ragerino

7 years ago

In Java you simply extend an Exception class (checked or unchecked) and handle it properly regardless of the error message.

Modern IDEs can detect exception types which don't exist yet, and create them on the fly while you try to use them for the first time.

This would be a replacement if Java had the concept of a continuation, but as far as I know that isn't the case.

Although in this case it simply seems a way to interact with some kind of environment, which in object oriented languages is easily achieved with dependency injection (which does mean you have to pass through an extra argument to every function, but that's not usually that big a problem, and it can give hints on how to combine and divide environments).