Skip to content

fix: Stop sending code argument to respond_with_error, it does not accept it#23

Merged
bougyman merged 2 commits into
mainfrom
fix-respond-with-error
Aug 5, 2025
Merged

fix: Stop sending code argument to respond_with_error, it does not accept it#23
bougyman merged 2 commits into
mainfrom
fix-respond-with-error

Conversation

@bougyman

@bougyman bougyman commented Aug 5, 2025

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings August 5, 2025 15:30
@bougyman bougyman added the bug Something isn't working label Aug 5, 2025
@bougyman bougyman self-assigned this Aug 5, 2025
@bougyman bougyman added the bug Something isn't working label Aug 5, 2025
@bougyman bougyman requested a review from BryceARich August 5, 2025 15:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a method signature mismatch in the respond_with_error method by removing the code parameter that was not being accepted by the underlying implementation.

  • Removed the code parameter from respond_with_error method signatures
  • Updated method calls to no longer pass the code argument
  • Updated tests to reflect the simplified error handling

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
lib/leopard/message_wrapper.rb Removed code parameter from respond_with_error method signature and call
test/lib/message_wrapper.rb Updated test mock and test cases to match new method signature
examples/echo_endpoint.rb Added new endpoint and reduced instance count (unrelated to main fix)
Comments suppressed due to low confidence (1)

test/lib/message_wrapper.rb:69

  • This test assertion expects only the error message, but the test doesn't explicitly call respond_with_error on line 67. The test should ensure it's testing the correct behavior by explicitly calling the method with the exception object.
    assert_equal ['broken'], msg.error_args

Comment thread lib/leopard/message_wrapper.rb Outdated
@@ -33,8 +33,8 @@ def respond(payload)
# @param code [Integer] The HTTP status code to use for the error response.

Copilot AI Aug 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation comment still references the removed code parameter. This should be removed to match the updated method signature.

Suggested change
# @param code [Integer] The HTTP status code to use for the error response.

Copilot uses AI. Check for mistakes.

@BryceARich BryceARich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bougyman bougyman merged commit 9d87b8c into main Aug 5, 2025
4 checks passed
@bougyman bougyman deleted the fix-respond-with-error branch August 5, 2025 15:32
This was referenced Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants