Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
00f9946d
Commit
00f9946d
authored
4 years ago
by
cvictory
Browse files
Options
Downloads
Patches
Plain Diff
modify return error and log
parent
6920c158
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cluster/cluster_impl/failover_cluster_invoker.go
+5
-2
5 additions, 2 deletions
cluster/cluster_impl/failover_cluster_invoker.go
common/proxy/proxy.go
+16
-1
16 additions, 1 deletion
common/proxy/proxy.go
with
21 additions
and
3 deletions
cluster/cluster_impl/failover_cluster_invoker.go
+
5
−
2
View file @
00f9946d
...
...
@@ -19,6 +19,7 @@ package cluster_impl
import
(
"context"
"fmt"
"strconv"
)
...
...
@@ -91,8 +92,10 @@ func (invoker *failoverClusterInvoker) Invoke(ctx context.Context, invocation pr
invokerSvc
:=
invoker
.
GetUrl
()
.
Service
()
invokerUrl
:=
invoker
.
directory
.
GetUrl
()
return
&
protocol
.
RPCResult
{
Err
:
perrors
.
Errorf
(
"Failed to invoke the method %v in the service %v. Tried %v times of the providers %v (%v/%v)from the registry %v on the consumer %v using the dubbo version %v. Last error is %v."
,
methodName
,
invokerSvc
,
retries
,
providers
,
len
(
providers
),
len
(
invokers
),
invokerUrl
,
ip
,
constant
.
Version
,
result
.
Error
()
.
Error
(),
Err
:
perrors
.
Wrap
(
result
.
Error
(),
fmt
.
Sprintf
(
"Failed to invoke the method %v in the service %v. "
+
"Tried %v times of the providers %v (%v/%v)from the registry %v on the consumer %v using the dubbo version %v. "
+
"Last error is %+v."
,
methodName
,
invokerSvc
,
retries
,
providers
,
len
(
providers
),
len
(
invokers
),
invokerUrl
,
ip
,
constant
.
Version
,
result
.
Error
()
.
Error
()),
)}
}
...
...
This diff is collapsed.
Click to expand it.
common/proxy/proxy.go
+
16
−
1
View file @
00f9946d
...
...
@@ -23,6 +23,11 @@ import (
"sync"
)
import
(
"github.com/apache/dubbo-go-hessian2/java_exception"
perrors
"github.com/pkg/errors"
)
import
(
"github.com/apache/dubbo-go/common"
"github.com/apache/dubbo-go/common/constant"
...
...
@@ -154,7 +159,17 @@ func (p *Proxy) Implement(v common.RPCService) {
}
err
=
result
.
Error
()
logger
.
Debugf
(
"[makeDubboCallProxy] result: %v, err: %v"
,
result
.
Result
(),
err
)
if
err
!=
nil
{
// the cause reason
err
=
perrors
.
Cause
(
err
)
if
throwabler
,
ok
:=
err
.
(
java_exception
.
Throwabler
);
ok
{
logger
.
Errorf
(
"invoke service throw exception: %v , stackTraceElements: %v"
,
err
.
Error
(),
throwabler
.
GetStackTrace
())
}
else
{
logger
.
Errorf
(
"result err: %v"
,
err
)
}
}
else
{
logger
.
Debugf
(
"[makeDubboCallProxy] result: %v, err: %v"
,
result
.
Result
(),
err
)
}
if
len
(
outs
)
==
1
{
return
[]
reflect
.
Value
{
reflect
.
ValueOf
(
&
err
)
.
Elem
()}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment