Skip to content

Commit

Permalink
fix typo problem
Browse files Browse the repository at this point in the history
  • Loading branch information
DMwangnima committed Dec 28, 2023
1 parent 8de92d0 commit 0879668
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/hessian2/exception/exception.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewException(detailMessage string) Throwabler {
//
// - If err is nil, it returns nil and false
//
// - If err implents Unwrap(), it would unwrap err until getting the real cause.
// - If err implements Unwrap(), it would unwrap err until getting the real cause.
// Then it would check cause whether implementing Throwabler. If yes, it returns
// Throwabler and true.
//
Expand Down
9 changes: 9 additions & 0 deletions pkg/hessian2/exception/exception_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package exception

import (
"io"
"testing"

"github.com/cloudwego/kitex/pkg/remote"
Expand Down Expand Up @@ -69,6 +70,14 @@ func TestFromError(t *testing.T) {
assert.True(t, ok)
},
},
{
desc: "TransError wraps DetailedError, DetailedError wraps non-Throwabler",
inputErr: remote.NewTransError(remote.InternalError, kerrors.ErrRemoteOrNetwork.WithCause(io.EOF)),
expected: func(t *testing.T, exception Throwabler, ok bool) {
assert.Nil(t, exception)
assert.False(t, ok)
},
},
}

for _, test := range tests {
Expand Down

0 comments on commit 0879668

Please sign in to comment.