As an alternate conceptual approach, you could say that everything inside the try block is the success path, while everything inside the catch block is the failure path.
Conceptually I like that a lot. If we'd have a way of defining thrown exceptions like Java's throws syntax, having the whole happy path inside the try block would feel a lot more comfortable.
As an alternate conceptual approach, you could say that everything inside the try block is the success path, while everything inside the catch block is the failure path.
Conceptually I like that a lot. If we'd have a way of defining thrown exceptions like Java's
throws
syntax, having the whole happy path inside the try block would feel a lot more comfortable.Yes indeed. It's in fact from my own Java experience that I've come to use the approach 😄.