robotLJW commented on a change in pull request #824:
URL: 
https://github.com/apache/servicecomb-service-center/pull/824#discussion_r554906400



##########
File path: datasource/etcd/dep.go
##########
@@ -35,23 +37,23 @@ func (ds *DataSource) SearchProviderDependency(ctx 
context.Context, request *pb.
        providerServiceID := request.ServiceId
        provider, err := serviceUtil.GetService(ctx, domainProject, 
providerServiceID)
 
-       if err != nil {
-               log.Errorf(err, "GetProviderDependencies failed, provider is 
%s", providerServiceID)
-               return nil, err
-       }
-       if provider == nil {
-               log.Errorf(err, "GetProviderDependencies failed for 
provider[%s] does not exist", providerServiceID)
+       if errors.Is(err, datasource.ErrNoDocuments) {

Review comment:
       这个方法就是判这个error是不是这类型的,是不是前提建立在不为nil的情况下!我个人认为是不是放在 if err!=nil 
里面会更好,再加判断,可以减少一次err为nil的判断




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to