Precise error typing in Swift

There’s a very active and much more recent thread about this topic. No need to resurrect one that has been dormant for a year.