Skip to content

Commit

Permalink
Changed encoding/decoding error code
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Levitskii <[email protected]>
  • Loading branch information
biosvs committed Mar 15, 2024
1 parent d33ff85 commit 7189d58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

=======
## [Unreleased]
- No changes yet.
### Changed
- errors: encoding/decoding (marshalling/unmarshalling) errors are now returned as CodeInternal (13) instead of CodeInvalidArgument (3).

## [1.72.1] - 2024-03-14
- tchannel: Renamed caller-procedure header from `$rpc$-caller-procedure` to `rpc-caller-procedure`.
Expand Down
2 changes: 1 addition & 1 deletion pkg/errors/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ func newClientEncodingError(req *transport.Request, isResponse bool, isHeader bo
parts = append(parts,
fmt.Sprintf("for procedure %q of service %q: %v",
req.Procedure, req.Service, err))
return yarpcerrors.Newf(yarpcerrors.CodeInvalidArgument, strings.Join(parts, " "))
return yarpcerrors.Newf(yarpcerrors.CodeInternal, strings.Join(parts, " "))
}
2 changes: 1 addition & 1 deletion pkg/errors/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func newServerEncodingError(req *transport.Request, encodings []transport.Encodi
parts = append(parts,
fmt.Sprintf("for procedure %q of service %q from caller %q: %v",
req.Procedure, req.Service, req.Caller, err))
return yarpcerrors.Newf(yarpcerrors.CodeInvalidArgument, strings.Join(parts, " "))
return yarpcerrors.Newf(yarpcerrors.CodeInternal, strings.Join(parts, " "))
}

func newEncodingMismatchError(want []transport.Encoding, got transport.Encoding) error {
Expand Down

0 comments on commit 7189d58

Please sign in to comment.