Skip to content

#1441: raise NoMethodError naming the real client for a method it doesn't have - #1459

Open
jack5505 wants to merge 1 commit into
zerocracy:masterfrom
jack5505:1441
Open

jack5505 wants to merge 1 commit into
zerocracy:masterfrom
jack5505:1441

Conversation

@jack5505

@jack5505 jack5505 commented Oct 8, 2026

Copy link
Copy Markdown

The client of Fbe.octo is wrapped with intercepted, which calls @o.method(mtd).parameters before the call. For a name the client doesn't have, Kernel#method raises NameError, not NoMethodError, and the message names an anonymous decorator class. A rescue NoMethodError written against Octokit, like the one in lib/qos_search.rb of judges-action, missed it.

The interceptor now checks respond_to? first and raises NoMethodError with the method name and the real client class, Octokit::Client or Fbe::FakeOctokit, the way a plain Octokit client does. Added a test for both clients; it fails without the fix.

Closes #1441

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fbe.octo raises NameError instead of NoMethodError for a method the client doesn't have, so rescue NoMethodError misses it

1 participant