Skip to content

Commit

Permalink
An unexpected backtick (#2284)
Browse files Browse the repository at this point in the history
* an unexpected backtick

* spec and changelog

Co-authored-by: zachary.zhang <[email protected]>
  • Loading branch information
zysend and zysend authored Oct 21, 2022
1 parent edc6abe commit 62562f8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* [#2250](https://github.com/ruby-grape/grape/pull/2250): Add deprecation warning for `UnsupportedGroupTypeError` and `MissingGroupTypeError` - [@ericproulx](https://github.com/ericproulx).
* [#2256](https://github.com/ruby-grape/grape/pull/2256): Raise `Grape::Exceptions::MultipartPartLimitError` from Rack when too many files are uploaded - [@bschmeck](https://github.com/bschmeck).
* [#2266](https://github.com/ruby-grape/grape/pull/2266): Fix code coverage - [@duffn](https://github.com/duffn).
* [#2284](https://github.com/ruby-grape/grape/pull/2284): Fix an unexpected backtick - [@zysend](https://github.com/zysend).
* Your contribution here.

### 1.6.2 (2021/12/30)
Expand Down
2 changes: 1 addition & 1 deletion lib/grape/middleware/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def rescue_handler_for_any_class(klass)

def run_rescue_handler(handler, error)
if handler.instance_of?(Symbol)
raise NoMethodError, "undefined method `#{handler}'" unless respond_to?(handler)
raise NoMethodError, "undefined method '#{handler}'" unless respond_to?(handler)

handler = public_method(handler)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2291,7 +2291,7 @@ def rescue_no_method_error
subject.rescue_from :all, with: :not_exist_method
subject.get('/rescue_method') { raise StandardError }

expect { get '/rescue_method' }.to raise_error(NoMethodError, /^undefined method `not_exist_method'/)
expect { get '/rescue_method' }.to raise_error(NoMethodError, /^undefined method 'not_exist_method'/)
end

it 'correctly chooses exception handler if :all handler is specified' do
Expand Down

0 comments on commit 62562f8

Please sign in to comment.