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

Streamline the creation of GRPC Exceptions #2571

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cmwigard
Copy link

@cmwigard cmwigard commented May 1, 2023

Motivation:

In reference to issue #2502, there should be a more convenient way to initialize GRPC Exceptions analogous to other GRPC implementations.

Modifications:

  • Removed the deprecation from GrpcStatus.asException as it is required for this implementation of desired functionality.
  • Added additional constructor for GrpcStatus to support initialization from codeValue and description.
  • Added convenience method GrpcStatusCode.withDescription to support desired functionality.
  • Added GrpcStatusTest.testGrpcStatusExceptionFromGrpcStatusCode for test-driven development and better test coverage.

Result:

GRPC Exceptions can now be initialized and thrown more conveniently.

…hods.

Motivation:

In reference to issue apple#2502, there should be a more convenient way to initialize GRPC Exceptions analogous to other GRPC implementations.

Modifications:

- Removed the deprecation from GrpcStatus.asException as it is required for this implementation of desired functionality.
- Added additional constructor for GrpcStatus to support initialization from codeValue and description.
- Added convenience method GrpcStatusCode.withDescription to support desired functionality.
- Added GrpcStatusTest.testGrpcStatusExceptionFromGrpcStatusCode for test-driven development and better test coverage.

Result:

GRPC Exceptions can now be initialized and thrown more conveniently.

What is the result of this change?
Motivation:

Cleaner code and commit

Modifications:

- Removed an unnecessary empty line from GrpcStatus as well as an unused import from GrpcStatusTest

Result:

Cleaned up for pull request
@cmwigard cmwigard changed the title Streamlined the creation of GRPC Exceptions by adding convenience method Streamline the creation of GRPC Exceptions May 1, 2023
*/
@Deprecated
public GrpcStatusException asException() { // FIXME: 0.43 - remove deprecated method
public GrpcStatusException asException() {
Copy link

@82baras 82baras Jul 22, 2023

Choose a reason for hiding this comment

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

Should we update deprecated code?

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

Successfully merging this pull request may close these issues.

2 participants