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

Review all internal errors #4915

Open
glpatcern opened this issue Nov 7, 2024 · 1 comment
Open

Review all internal errors #4915

glpatcern opened this issue Nov 7, 2024 · 1 comment

Comments

@glpatcern
Copy link
Member

The current code base uses status.NewInternal() in far too many places as a "shortcut" to report an error. In many/most occurrences, a more tailored error code should be used for the caller to display proper error messages, and logging should be adapted as well.

Here follows the count per GRPC service:

applicationauth: 4
appregistry: 6
authregistry: 2
datatx: 4
gateway: 104
groupprovider: 5
ocmcore: 1
ocminvitemanager: 10
ocmproviderauthorizer: 3
ocmshareprovider: 12
preferences: 2
publicshareprovider: 6
publicstorageprovider: 9
storageprovider: 64
storageregistry: 3
userprovider: 4
usershareprovider: 8
@jessegeens
Copy link
Contributor

We should also try to get rid of this pattern:

	err := s.sm.Unshare(ctx, req.Ref)
	if err != nil {
		return &collaboration.RemoveShareResponse{
			Status: status.NewInternal(ctx, err, "error removing share"),
		}, nil
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants