Newer versions of Ruby return KeyError. However, IndexError is the parent of KeyError, so your answer is technically correct.