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

Throw clearer error message during Stash() in null message cases #7425

Merged
merged 2 commits into from
Dec 19, 2024

Conversation

Aaronontheweb
Copy link
Member

@Aaronontheweb Aaronontheweb commented Dec 19, 2024

Changes

close #7398

Checklist

For significant changes, please ensure that the following have been completed (delete if not relevant):

Copy link
Member Author

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

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

Detailed my changes

if (_actorCell.CurrentEnvelopeId == _currentEnvelopeId)
{
if(currMsg is null)
throw new InvalidOperationException("There is no message to stash right now. Stash() must be called inside an actor's Receive methods.");
Copy link
Member Author

Choose a reason for hiding this comment

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

Provide a clearer explanation of why we're throwing an exception

@Aaronontheweb Aaronontheweb merged commit 7e85cac into akkadotnet:dev Dec 19, 2024
10 of 12 checks passed
@Aaronontheweb Aaronontheweb deleted the fix-7938-IllegalStash branch December 19, 2024 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Misleading error text when IllegalActorStateException is raised on attemp to stash a lifecycle message
1 participant