What? This is one of the areas where type safety truly shines. Type safe languages force you to confirm the nature of the input and deal with the edge cases.
the use of option and return types instead of nulls and exceptions does help a bit. you can’t forget to deal with the failure cases.