Exceptions are about control flow. Nulls and undefined are about types. The flow generally continues on with the latter. So I’m wondering what the term is for when you have a whole slew of invalid types but continue on without any exception handling and instead handle it via type systems.
What I'm looking for is a name for a pattern where a function returns (typeof ExpectedType | typeof InvalidType). Say it's a pipelined compiler and you want all the passes to continue even with InvalidTypes, and then at the end of the pipeline the result is a structure of the correct shape, but there may be some "holes" filled with InvalidTypes.
So one way to say it is exception types without the Try/Catch.
You're thinking of "try ... catch", but that's not what I'm talking about. What I'm talking about, and what I wrote, was "exceptions", i.e., objects that signify you're dealing with an exceptional case.
> Nulls and undefined are about types.
Anything that can be checked with instanceof, as I'm alluding to and as described in the first comment, or cross-checked by comparing a tag against constant, as in the case of node types in the DOM, is "about types".
What you describe as "just check[ing] if a value is an instance of InvalidType" is a straightforward restatement of how to represent an exception and handle it. Give it extra fields with further details, etc. This is widely used, it's just not widely used in in the NodeJS world, but that has more to do with the dubious influence that people like OP have, and all the programmers who try to emulate his style.
I'm only familiar with Exceptions in C++, Java, C#, Python, Javascript, etc. Are there languages where "Exceptions" are used without Try/catch? To me the term implies Exception Types/Try/Catch.
If this isn't clear enough at this point, it's unlikely to be worth anyone's time to explain it (again). An exception can exist and serve a purpose without ever having to be be thrown, and the thing thrown in a throw statement doesn't have to be an exception. Exceptions and "try ... catch" are completely orthogonal. The question is fundamentally... sideways.