Skip to content
Snippets Groups Projects
Commit 9f1a565d authored by fangyincheng's avatar fangyincheng
Browse files

Fix:issue #68

parent 0541c85f
No related branches found
No related tags found
No related merge requests found
......@@ -25,10 +25,13 @@ import (
)
import (
"github.com/apache/dubbo-go/config"
hessian "github.com/dubbogo/hessian2"
)
import (
"github.com/apache/dubbo-go/config"
)
type Gender hessian.JavaEnum
func init() {
......
......@@ -26,11 +26,11 @@ import (
)
import (
"github.com/apache/dubbo-go/common/logger"
hessian "github.com/dubbogo/hessian2"
)
import (
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/config"
_ "github.com/apache/dubbo-go/protocol/dubbo"
_ "github.com/apache/dubbo-go/registry/protocol"
......
......@@ -146,7 +146,7 @@ func (u *UserProvider) GetUser(ctx context.Context, req []interface{}, rsp *User
}
func (u *UserProvider) GetErr(ctx context.Context, req []interface{}, rsp *User) error {
return perrors.New("exception")
return hessian.NewThrowable("exception")
}
func (u *UserProvider) GetUser0(id string, name string) (User, error) {
......
......@@ -59,9 +59,9 @@ public class Consumer {
}
try {
userProvider.GetErr("A003");
} catch (Exception e) {
} catch (Throwable t) {
System.out.println("*************exception***********");
e.printStackTrace();
t.printStackTrace();
}
}
......
......@@ -2,7 +2,7 @@ module github.com/apache/dubbo-go
require (
github.com/dubbogo/getty v0.0.0-20190523180329-bdf5e640ea53
github.com/dubbogo/hessian2 v0.0.0-20190604191323-5290af08fb56
github.com/dubbogo/hessian2 v0.0.0-20190606185624-13bbc9786e3f
github.com/pkg/errors v0.8.1
github.com/samuel/go-zookeeper v0.0.0-20180130194729-c4fab1ac1bec
github.com/stretchr/testify v1.3.0
......
......@@ -74,7 +74,7 @@ func (p *DubboPackage) Marshal() (*bytes.Buffer, error) {
}
func (p *DubboPackage) Unmarshal(buf *bytes.Buffer, opts ...interface{}) error {
codec := hessian.NewHessianCodec(bufio.NewReader(buf))
codec := hessian.NewHessianCodec(bufio.NewReaderSize(buf, buf.Len()))
// read header
err := codec.ReadHeader(&p.Header)
......
......@@ -22,16 +22,20 @@ import (
"reflect"
"sync"
"time"
)
import (
"github.com/dubbogo/getty"
"github.com/dubbogo/hessian2"
perrors "github.com/pkg/errors"
)
import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/protocol"
"github.com/apache/dubbo-go/protocol/invocation"
hessian "github.com/dubbogo/hessian2"
perrors "github.com/pkg/errors"
)
// todo: WritePkg_Timeout will entry *.yml
......@@ -323,7 +327,7 @@ func (h *RpcServerHandler) callService(req *DubboPackage, ctx context.Context) {
}
if retErr != nil {
req.Header.ResponseStatus = hessian.Response_OK
req.Body = perrors.WithStack(retErr.(error))
req.Body = retErr
} else {
req.Body = replyv.Interface()
}
......
......@@ -29,7 +29,6 @@ import (
)
import (
"github.com/apache/dubbo-go/common/logger"
perrors "github.com/pkg/errors"
"github.com/samuel/go-zookeeper/zk"
)
......@@ -38,6 +37,7 @@ import (
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
"github.com/apache/dubbo-go/common/extension"
"github.com/apache/dubbo-go/common/logger"
"github.com/apache/dubbo-go/common/utils"
"github.com/apache/dubbo-go/registry"
"github.com/apache/dubbo-go/version"
......
......@@ -25,11 +25,14 @@ import (
)
import (
"github.com/apache/dubbo-go/common/logger"
perrors "github.com/pkg/errors"
"github.com/samuel/go-zookeeper/zk"
)
import (
"github.com/apache/dubbo-go/common/logger"
)
var (
errNilZkClientConn = perrors.New("zookeeperclient{conn} is nil")
)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment