From b3ea2c6b463819521e9cc34e0734388296e42b80 Mon Sep 17 00:00:00 2001 From: Jordan Hrycaj Date: Thu, 16 Jun 2022 16:19:53 +0100 Subject: [PATCH] Normalise `KeyError` exception message (#119) --- stew/keyed_queue.nim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stew/keyed_queue.nim b/stew/keyed_queue.nim index 55d0755..658b4a4 100644 --- a/stew/keyed_queue.nim +++ b/stew/keyed_queue.nim @@ -380,14 +380,12 @@ proc delete*[K,V](rq: var KeyedQueue[K,V]; key: K): ## Delete the item with key `key` from the queue and returns the key-value ## item pair just deleted (if any). if rq.tab.hasKey(key): - try: + noKeyError("delete"): let kvp = KeyedQueuePair[K,V]( key: key, data: rq.tab[key].data) rq.deleteImpl(key) return ok(kvp) - except KeyError: - raiseAssert "We've checked that the key is present above" err() proc del*[K,V](rq: var KeyedQueue[K,V]; key: K) =