Skip to content

fix: support optional backtrace fields and types #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 2, 2025
Merged

fix: support optional backtrace fields and types #9

merged 5 commits into from
Aug 2, 2025

Conversation

joshuap
Copy link
Member

@joshuap joshuap commented Aug 2, 2025

  • allow string and int types for backtrace number field
  • add missing optional backtrace field types
  • coerce number/column fields to int instead of string

Fixes #8

Copilot

This comment was marked as outdated.

@joshuap joshuap requested a review from Copilot August 2, 2025 03:36
Copy link

@Copilot Copilot AI left a comment

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 backtrace field handling by adding support for flexible number field types and missing optional fields. The changes ensure the API can properly unmarshal backtrace data that may contain numbers as either strings or integers.

  • Introduces a custom Number type that handles both string and integer JSON values
  • Adds missing optional backtrace fields (column, class, type, args)
  • Updates the Number field in BacktraceEntry to use the new flexible type

Reviewed Changes

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

File Description
internal/hbapi/types.go Adds custom Number type with flexible JSON unmarshaling and updates BacktraceEntry with missing optional fields
internal/hbapi/types_test.go Comprehensive test coverage for Number unmarshaling and BacktraceEntry with all field variations

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@joshuap joshuap merged commit b5e8028 into main Aug 2, 2025
3 checks passed
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.

list_fault_notices broken
2 participants