Skip to content

Commit

Permalink
consistent error context; also fix type leak in envelopeReader (misse…
Browse files Browse the repository at this point in the history
…d in first commit)
  • Loading branch information
jhump committed Oct 3, 2023
1 parent 72f3578 commit 50535ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion envelope.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (r *envelopeReader) Unmarshal(message any) *Error {
}

if err := r.codec.Unmarshal(data.Bytes(), message); err != nil {
return errorf(CodeInvalidArgument, "unmarshal into %T: %w", message, err)
return errorf(CodeInvalidArgument, "unmarshal message: %w", err)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion protocol_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@ func (u *connectUnaryUnmarshaler) UnmarshalFunc(message any, unmarshal func([]by
data = decompressed
}
if err := unmarshal(data.Bytes(), message); err != nil {
return NewError(CodeInvalidArgument, err)
return errorf(CodeInvalidArgument, "unmarshal message: %w", err)
}
return nil
}
Expand Down

0 comments on commit 50535ea

Please sign in to comment.