summary refs log tree commit diff stats
path: root/lib/pure/collections
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/collections')
-rw-r--r--lib/pure/collections/sets.nim2
-rw-r--r--lib/pure/collections/tables.nim6
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/pure/collections/sets.nim b/lib/pure/collections/sets.nim
index 22eff9c55..3adf21a25 100644
--- a/lib/pure/collections/sets.nim
+++ b/lib/pure/collections/sets.nim
@@ -129,7 +129,7 @@ proc mget*[A](s: var TSet[A], key: A): var A =
   assert s.isValid, "The set needs to be initialized."
   var index = rawGet(s, key)
   if index >= 0: result = t.data[index].key
-  else: raise newException(EInvalidKey, "key not found: " & $key)
+  else: raise newException(KeyError, "key not found: " & $key)
 
 proc contains*[A](s: TSet[A], key: A): bool =
   ## Returns true iff `key` is in `s`.
diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim
index dcf2ab481..95caf9195 100644
--- a/lib/pure/collections/tables.nim
+++ b/lib/pure/collections/tables.nim
@@ -144,7 +144,7 @@ proc mget*[A, B](t: var TTable[A, B], key: A): var B =
   ## If `key` is not in `t`, the ``EInvalidKey`` exception is raised.
   var index = rawGet(t, key)
   if index >= 0: result = t.data[index].val
-  else: raise newException(EInvalidKey, "key not found: " & $key)
+  else: raise newException(KeyError, "key not found: " & $key)
 
 iterator allValues*[A, B](t: TTable[A, B]; key: A): B =
   ## iterates over any value in the table `t` that belongs to the given `key`.
@@ -411,7 +411,7 @@ proc mget*[A, B](t: var TOrderedTable[A, B], key: A): var B =
   ## If `key` is not in `t`, the ``EInvalidKey`` exception is raised.
   var index = rawGet(t, key)
   if index >= 0: result = t.data[index].val
-  else: raise newException(EInvalidKey, "key not found: " & $key)
+  else: raise newException(KeyError, "key not found: " & $key)
 
 proc hasKey*[A, B](t: TOrderedTable[A, B], key: A): bool =
   ## returns true iff `key` is in the table `t`.
@@ -663,7 +663,7 @@ proc mget*[A](t: var TCountTable[A], key: A): var int =
   ## If `key` is not in `t`, the ``EInvalidKey`` exception is raised.
   var index = rawGet(t, key)
   if index >= 0: result = t.data[index].val
-  else: raise newException(EInvalidKey, "key not found: " & $key)
+  else: raise newException(KeyError, "key not found: " & $key)
 
 proc hasKey*[A](t: TCountTable[A], key: A): bool =
   ## returns true iff `key` is in the table `t`.