added error
This commit is contained in:
parent
a8cc8008db
commit
8c8aa1069a
|
@ -61,6 +61,8 @@ func (s *ServiceImpl) ExecServices(c context.Context, in *pb.ServiceInput) (*pb.
|
||||||
// Check Service Name
|
// Check Service Name
|
||||||
serviceName, ok := g_services[in.ServiceName]
|
serviceName, ok := g_services[in.ServiceName]
|
||||||
|
|
||||||
|
log.Println("Service Name : " + in.ServiceName + " MethodName : " + in.MethodName)
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
||||||
return nil, errors.New("Not Exist Service Name")
|
return nil, errors.New("Not Exist Service Name")
|
||||||
|
@ -82,7 +84,20 @@ func (s *ServiceImpl) ExecServices(c context.Context, in *pb.ServiceInput) (*pb.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Todo Call Service Method
|
// Todo Call Service Method
|
||||||
result := methodName.Call(params)[0].String()
|
results := methodName.Call(params);
|
||||||
|
|
||||||
|
result := results[0].Interface().(string)
|
||||||
|
|
||||||
|
var err error = nil;
|
||||||
|
if len(result) > 1 {
|
||||||
|
obj := results[1].Interface()
|
||||||
|
if obj != nil {
|
||||||
|
log.Println("err : " + err.Error())
|
||||||
|
err = obj.(error)
|
||||||
|
return pbs, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
pbs.ResultStr = result
|
pbs.ResultStr = result
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user