Better error message when missing "when"