diff -r 16dae12ac0f0 -r 97de6058109e parse.py --- a/parse.py Fri Sep 18 20:46:26 2020 +0300 +++ b/parse.py Fri Sep 18 20:59:59 2020 +0300 @@ -41,7 +41,13 @@ def find_first_header_object(self, object_type): return self.find_header_object(object_type, 0) def find_header_object(self, object_type, n): - return self.body[self.header.occurrences[object_type][n]] + try: + return self.body[self.header.occurrences[object_type][n]] + except IndexError: + raise KeyError(str.format( + '{type} not found in header', + type = object_type + )) def model_vertices( model,