Error Handling 5
- The downside of
if try
is that it usually puts the main code inside of a block. - We can instead use
if catch
which instead executes on an optional to get the error. And if there is areturn
from thisif
then the variable will be considered checked to be a real type.