Skip to content

feat: serialize error payloads - #61

Merged
gabeodess merged 7 commits into
mainfrom
serialize-errors
Sep 18, 2026
Merged

gabeodess merged 7 commits into
mainfrom
serialize-errors

Conversation

@gabeodess

Copy link
Copy Markdown
Contributor

Automatically serializes error payloads so the consumer doesn't need to think about it.

@gabeodess gabeodess self-assigned this Sep 17, 2026
Copilot AI lite review requested due to automatic review settings September 17, 2026 15:40

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.

🟡 Changes recommended

JSON serialization currently breaks the established exception pass-through path.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Automatically serializes non-string error payloads in MessageWrapper.

Changes:

  • Serializes error payloads as JSON.
  • Updates hash-payload test coverage.
  • Ignores .idea files.
File summaries
File Summary
test/lib/message_wrapper.rb Updates hash serialization coverage.
lib/leopard/message_wrapper.rb Serializes error responses; exception pass-through must be preserved.
.gitignore Adds .idea to ignored files.
Review details
  • Files reviewed: 2/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/leopard/message_wrapper.rb Outdated

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.

🟡 Changes recommended

Structured NATS error metadata and payload preservation regress, and related documentation requires updating.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

lib/leopard/message_wrapper.rb:42

  • This changes the public request/reply contract, but the current documentation still says that respond_with_error returns the same failure payload (documents/enable-injectable-request-reply-callbacks.adoc:41-42 and Readme.adoc:110-111). Hash and other non-Exception failures now reach the consumer as JSON strings, so please update those docs to describe serialization and the exception passthrough exception.
        raw.respond_with_error(err.is_a?(Exception) ? err : serialize(err), &)
  • Files reviewed: 2/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread lib/leopard/message_wrapper.rb Outdated

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.

🟡 Changes recommended

Address the incomplete error serialization, metrics content-type mismatch, and inconsistent release version sources.

Get a fresh assessment by requesting another Copilot review.

Review details
  • Files reviewed: 3/5 changed files
  • Comments generated: 3
  • Review effort level: Lite

Comment thread lib/leopard/version.rb
Comment thread lib/leopard/metrics_server.rb
Comment thread lib/leopard/metrics_server.rb Outdated
Co-authored-by: gabeodess <65213+gabeodess@users.noreply.github.com>
auto-merge was automatically disabled September 17, 2026 18:12

Head branch was pushed to by a user without write access

Co-authored-by: gabeodess <65213+gabeodess@users.noreply.github.com>

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.

🟢 Approval recommended

No unresolved blocking issues were identified.

Review details
  • Files reviewed: 5/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

🔵 Needs a closer look

Content type is determined after serialization, causing the added JSON response test to fail.

Review details

Suppressed comments (1)

lib/leopard/metrics_server.rb:67

  • body has already been converted to a String on the preceding line, so this condition is always true and hash payloads are sent with the Prometheus text/plain content type. The added test expects application/json and currently fails; determine the content type before serializing the body.
          body = JSON.generate(body) unless body.is_a?(String)
          content_type = body.is_a?(String) ? 'text/plain; version=0.0.4' : 'application/json'
  • Files reviewed: 5/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

🟢 Approval recommended

No unresolved review comments or blocking concerns remain.

Review details
  • Files reviewed: 5/7 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@gabeodess
gabeodess merged commit e87f709 into main Sep 18, 2026
6 checks passed
@gabeodess
gabeodess deleted the serialize-errors branch September 18, 2026 15:34
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.

4 participants