A type constraint can verify that capacity is a number without proving that the number is acceptable. Variable validation adds a condition with a useful error message.
Resource preconditions and postconditions check assumptions at the point where the required information is available. Choose a condition that states the operational rule directly and gives the caller a way to repair the value. Do not use a friendly message to hide an unrelated provider failure. In these exercises, the module accepts positive capacity up to a stated ceiling. Fix the input while retaining the rule so future callers receive the same protection.
Validation checks value rules in addition to types.