Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit bab718f

Browse files
committed
KeyErrors should have messages.
1 parent 0ac6123 commit bab718f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hyper/common/headers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def __getitem__(self, key):
5050
values.append(v)
5151

5252
if not values:
53-
raise KeyError()
53+
raise KeyError("Nonexistent header key: {}".format(key))
5454

5555
return values
5656

@@ -73,7 +73,7 @@ def __delitem__(self, key):
7373
indices.append(i)
7474

7575
if not indices:
76-
raise KeyError()
76+
raise KeyError("Nonexistent header key: {}".format(key))
7777

7878
for i in indices[::-1]:
7979
self._items.pop(i)

0 commit comments

Comments
 (0)