Skip to content

Commit 7189d58

Browse files
committed
Changed encoding/decoding error code
Signed-off-by: Vitalii Levitskii <[email protected]>
1 parent d33ff85 commit 7189d58

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

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

1112
## [1.72.1] - 2024-03-14
1213
- tchannel: Renamed caller-procedure header from `$rpc$-caller-procedure` to `rpc-caller-procedure`.

pkg/errors/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,5 @@ func newClientEncodingError(req *transport.Request, isResponse bool, isHeader bo
7171
parts = append(parts,
7272
fmt.Sprintf("for procedure %q of service %q: %v",
7373
req.Procedure, req.Service, err))
74-
return yarpcerrors.Newf(yarpcerrors.CodeInvalidArgument, strings.Join(parts, " "))
74+
return yarpcerrors.Newf(yarpcerrors.CodeInternal, strings.Join(parts, " "))
7575
}

pkg/errors/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func newServerEncodingError(req *transport.Request, encodings []transport.Encodi
9898
parts = append(parts,
9999
fmt.Sprintf("for procedure %q of service %q from caller %q: %v",
100100
req.Procedure, req.Service, req.Caller, err))
101-
return yarpcerrors.Newf(yarpcerrors.CodeInvalidArgument, strings.Join(parts, " "))
101+
return yarpcerrors.Newf(yarpcerrors.CodeInternal, strings.Join(parts, " "))
102102
}
103103

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

0 commit comments

Comments
 (0)