Skip to content

Commit cb72b85

Browse files
committed
fix: Use endpoint.class instead of endpoint.inspect in error message
Some Grape versions have protected inspect methods on endpoint objects. Use endpoint.class for the error message instead, which is simpler and works reliably across all Grape versions (1.8.0, 2.1.3, 2.4.0, 3.0+). This resolves failures when testing with Ruby 3.1.0 and Grape 2.1.3.
1 parent c0d2b72 commit cb72b85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/grape-swagger/token_owner_resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def resolve(endpoint, method_name)
1616
helper_value = resolve_from_helpers(endpoint, method_name)
1717
return helper_value unless helper_value.equal?(UNRESOLVED)
1818

19-
raise Errors::TokenOwnerNotFound, "undefined method `#{method_name}` for #{endpoint.inspect}"
19+
raise Errors::TokenOwnerNotFound, "undefined method `#{method_name}` for #{endpoint.class}"
2020
end
2121

2222
def evaluate_proc(callable, token_owner)

0 commit comments

Comments
 (0)