Sometimes you want a small closed world: a network result is either Success or Error — nothing else should sneak in at compile time. sealed class (or sealed interface) locks the hierarchy: subclasses live in the same module, and the compiler knows every case when you when over it. Exhaustive when — fewer forgotten branches, fewer Friday-night bugs.
Seal the envelope