Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scality/go-errors
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.0
Choose a base ref
...
head repository: scality/go-errors
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.3.0
Choose a head ref
  • 4 commits
  • 4 files changed
  • 1 contributor

Commits on Jun 4, 2026

  1. fix: Drop the stack trace from Error()

    Error() (and the %s/%q verbs) is the message form: it feeds CLI output,
    %w chains and any logger that prints err.Error(). Baking the stack into
    it left no way to get the plain message and produced noisy
    "... at=[(func='...', file='...', line='...')]" tails wherever an error
    was shown to a human.
    
    Error() now carries only title, identifier, details, properties and
    cause. The full message-plus-stack dump stays available through the %+v
    verb (unchanged). The "(identifier)" segment is also omitted when no
    identifier is set, so untyped errors read "title: detail" instead of
    "title (): detail".
    
    Note: this changes the string returned by Error(); callers that parsed
    it for the stack must switch to %+v.
    TeddyAndrieux committed Jun 4, 2026
    Configuration menu
    Copy the full SHA
    e8e6393 View commit details
    Browse the repository at this point in the history
  2. feat: Render errors consistently under slog via LogValuer

    slog's handlers serialise an error value differently: the JSON handler
    falls back to err.Error() (a string) while the text handler uses %+v
    (JSON). Combined with go-errors' formatting that inverts the output —
    text logs show JSON, JSON logs show the bare message.
    
    Implement slog.LogValuer on *Error so both handlers resolve the same
    structured group: title, identifier, details, properties, cause and the
    stack. JSON consumers get queryable fields (the stack as an array of
    {function,file,line} objects); the text handler renders each frame via
    the new Trace.String(), so the stack reads as "<func> <file>:<line>"
    instead of pointer addresses.
    
    The stack is part of the log form (post-mortem debugging) but stays out
    of Error() (the human/CLI form): the two audiences are served on purpose.
    TeddyAndrieux committed Jun 4, 2026
    Configuration menu
    Copy the full SHA
    5001514 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4ac88af View commit details
    Browse the repository at this point in the history
  4. Merge pull request #28 from scality/feature/properly-handle-logger

    Render errors cleanly for both CLIs and structured logs
    TeddyAndrieux authored Jun 4, 2026
    Configuration menu
    Copy the full SHA
    ee07d3e View commit details
    Browse the repository at this point in the history
Loading