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

Add GrainException to support better error handling from generated grains #2157

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

Conversation

benbenwilde
Copy link
Contributor

Add GrainException which enables throwing a GrainException back on the grain client with a specific message and code from inside a grain message handler. This enables application code to easily provide different error handling behavior based on the code.

For example, if i want to throw an error inside of a grain handler due to bad user input. Right now it just throws a plain exception on the client. With GrainException and especially the new Code property, we can pass something to indicate that the error was due to user input, and not some other unknown error in the code.

This change is fully backwards compatible with existing generated grains and usage.

Description

Purpose

This pull request is a:

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

…e grain client with a specific message and code from inside a grain message handler. This enable application code to easily provide different error handling behavior based on the 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.

1 participant