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

Fix dpservice-cli crash when running before initialisation #641

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

vlorinc
Copy link
Contributor

@vlorinc vlorinc commented Jan 22, 2025

Unify error handling accross all commands

  • change in dpservice-go library: unified the return values of gRPC functions
  • this fixes dpservice-cli crashes when running commands before initialisation #639; empty struct is now always returned and accessing Status.Code field doesn't crash dpservice-cli
  • changes in dpservice-cli: removed checking for Status.Code as it is handled by error value
  • removed the check of Status.Code from RenderList(), Status is checked before, errorous Lists are not rendered and error is returned

Fixes #639

@vlorinc vlorinc self-assigned this Jan 22, 2025
@vlorinc vlorinc linked an issue Jan 22, 2025 that may be closed by this pull request
@github-actions github-actions bot added size/M bug Something isn't working labels Jan 22, 2025
@vlorinc vlorinc force-pushed the fix/dpservice-cli/crash_before_init branch from 2138bf5 to 6a6fefb Compare January 23, 2025 13:59
Copy link
Collaborator

@guvenc guvenc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my question in the comments

go/dpservice-go/client/client.go Show resolved Hide resolved
@guvenc guvenc marked this pull request as ready for review January 28, 2025 09:26
@guvenc guvenc requested a review from a team as a code owner January 28, 2025 09:26
Copy link
Collaborator

@guvenc guvenc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@guvenc
Copy link
Collaborator

guvenc commented Jan 28, 2025

@vlorinc
Could you please rebase to main ?

- change in dpservice-go library: unified the return values of gRPC functions
- this fixes #639; empty struct is now always returned and accessing Status.Code field doesn't crash dpservice-cli
- changes in dpservice-cli: removed checking for Status.Code as it is handled by error value
- removed the check of Status.Code from RenderList(), Status is checked before, errorous Lists are not rendered and error is returned
@vlorinc vlorinc force-pushed the fix/dpservice-cli/crash_before_init branch from 6a6fefb to 65b4ef4 Compare January 28, 2025 11:43
@guvenc guvenc merged commit 6b6e487 into main Jan 28, 2025
6 checks passed
@guvenc guvenc deleted the fix/dpservice-cli/crash_before_init branch January 28, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dpservice-cli crashes when running commands before initialisation
2 participants