Return a proper error if the hash lookup fails.