Skip to content

Conversation

@debuggerpk
Copy link
Collaborator

Several key improvements to the erratic package:

  • Stack Trace Capture: The New function now automatically captures the stack frame where the error is created, providing valuable debugging information.
  • Slog Integration: Implemented slog.LogValuer for QuantmError, allowing for structured logging of error details.
  • Hint Type Flexibility: The Hints type in internal/erratic/hints.go has been changed from map[string]string to map[string]any, enabling the storage of non-string values as hints.
  • Proto/Connect Error Stringification: When converting errors to proto or Connect errors, hints are now stringified to ensure compatibility.
  • New Test Cases: Added comprehensive unit tests for the QuantmError type, covering hint handling, stack trace scenarios, and the New function.

Several key improvements to the `erratic` package:

- **Stack Trace Capture:** The `New` function now automatically captures
  the stack frame where the error is created, providing valuable
  debugging information.
- **Slog Integration:** Implemented `slog.LogValuer` for `QuantmError`,
  allowing for structured logging of error details.
- **Hint Type Flexibility:** The `Hints` type in
  `internal/erratic/hints.go` has been changed from `map[string]string`
  to `map[string]any`, enabling the storage of non-string values as
  hints.
- **Proto/Connect Error Stringification:** When converting errors to
  proto or Connect errors, hints are now stringified to ensure
  compatibility.
- **New Test Cases:** Added comprehensive unit tests for the
  `QuantmError` type, covering hint handling, stack trace scenarios, and
  the `New` function.
@debuggerpk debuggerpk merged commit 5e02542 into main Jan 1, 2026
1 check failed
@debuggerpk debuggerpk deleted the improve-error-handling branch January 1, 2026 12:22
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.

2 participants