Skip to content

Commit

Permalink
Fixed error messages due to copy/paste (too much boiler-plate coding?) (
Browse files Browse the repository at this point in the history
  • Loading branch information
glpatcern authored Jul 31, 2020
1 parent 6053083 commit 51106c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 3 additions & 0 deletions changelog/unreleased/fix-error-strings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Bugfix: Fixed some error reporting strings and corresponding logs

https://github.com/cs3org/reva/pull/1034
4 changes: 2 additions & 2 deletions internal/grpc/services/gateway/appregistry.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
func (s *svc) GetAppProviders(ctx context.Context, req *registry.GetAppProvidersRequest) (*registry.GetAppProvidersResponse, error) {
c, err := pool.GetAppRegistryClient(s.c.AppRegistryEndpoint)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetOCMShareProviderClient")
err = errors.Wrap(err, "gateway: error calling GetAppRegistryClient")
return &registry.GetAppProvidersResponse{
Status: status.NewInternal(ctx, err, "error getting user share provider client"),
}, nil
Expand All @@ -47,7 +47,7 @@ func (s *svc) GetAppProviders(ctx context.Context, req *registry.GetAppProviders
func (s *svc) ListAppProviders(ctx context.Context, req *registry.ListAppProvidersRequest) (*registry.ListAppProvidersResponse, error) {
c, err := pool.GetAppRegistryClient(s.c.AppRegistryEndpoint)
if err != nil {
err = errors.Wrap(err, "gateway: error calling GetOCMShareProviderClient")
err = errors.Wrap(err, "gateway: error calling GetAppRegistryClient")
return &registry.ListAppProvidersResponse{
Status: status.NewInternal(ctx, err, "error getting user share provider client"),
}, nil
Expand Down
7 changes: 2 additions & 5 deletions internal/grpc/services/gateway/usershareprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,15 +367,12 @@ func (s *svc) createReference(ctx context.Context, resourceID *provider.Resource

statRes, err := c.Stat(ctx, statReq)
if err != nil {
log.Err(err).Msg("gateway: error calling Stat for the share resource id:" + resourceID.String())
return &rpc.Status{
Code: rpc.Code_CODE_INTERNAL,
}, nil
return status.NewInternal(ctx, err, "gateway: error calling Stat for the share resource id: "+resourceID.String()), nil
}

if statRes.Status.Code != rpc.Code_CODE_OK {
err := status.NewErrorFromCode(statRes.Status.GetCode(), "gateway")
log.Err(err).Msg("gateway: error calling Stat for the share resource id:" + resourceID.String())
log.Err(err).Msg("gateway: Stat failed on the share resource id: " + resourceID.String())
return status.NewInternal(ctx, err, "error updating received share"), nil
}

Expand Down

0 comments on commit 51106c7

Please sign in to comment.