That’s what (unchecked) exceptions are for.
They’re supported by all general purpose programming languages because we — as developers — are smarter than the compiler.
They’re supported by all general purpose programming languages because we — as developers — are smarter than the compiler.
2. Not “all general purpose programming languages” support exceptions. To name a few that don’t: C, Rust, Go.