Project

General

Profile

Actions

Bug #16599

closed

did_you_mean is not activated for NameError and KeyError

Added by sawa (Tsuyoshi Sawada) about 4 years ago. Updated about 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
2.6, 2.7, perhaps for earlier versions too
[ruby-core:97012]

Description

This document claims that the did_you_mean gem responds to NameError, NoMethodError, and KeyError, but it actually seems to only respond to NoMethodError.

foo()
# >> NoMethodError: undefined method `foo' for main:Object
# >> Did you mean?  for

foo
# >> NameError: undefined local variable or method `foo' for main:Object

Foo
# >> NameError: uninitialized constant Foo

{foo: 1}.fetch(:bar)
# >> KeyError: key not found: :bar
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0