lib/gm/notepad/table.rb in gm-notepad-0.0.5 vs lib/gm/notepad/table.rb in gm-notepad-0.0.6

- old
+ new

@@ -8,10 +8,14 @@ process(lines: lines) end def lookup(index: false) if index - @table.fetch(index) + begin + @table.fetch(index.to_s) + rescue KeyError + raise MissingTableEntryError.new(table_name: table_name, index: index.to_s) + end else @table.values[random_index] end end