concept predictable state in category swift
appears as: predictable state, A predictable state

This is an excerpt from Manning's book Swift in Depth.
The first section goes over Swift errors and how to throw them. It also covers some best practices to keep your code in a predictable state when your functions start throwing errors.
Generally speaking, keeping a throwing function in a predictable state after it throws an error is a good habit to get into.
A predictable state prevents the environment from being in limbo between an error state and a sort-of-okay state. Keeping an application in a predictable state means that when a function or method throws an error, it should prevent, or undo, any changes that it has done to the environment or instance.