Skip to content

Streamline the creation of GRPC Exceptions #2571

New issue

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

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

Already on GitHub? # to your account

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.

cmwigard added 2 commits May 1, 2023 02:38
…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
@daschl daschl requested review from idelpivnitskiy and daschl May 2, 2023 05:09
*/
@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?

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

Successfully merging this pull request may close these issues.

2 participants