Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed error messages due to copy/paste #1034

Merged
merged 1 commit into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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