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

Improve error messages #67

Merged
merged 5 commits into from
Aug 9, 2021
Merged

Improve error messages #67

merged 5 commits into from
Aug 9, 2021

Conversation

asosMikeGore
Copy link

Improves error message consistency to resolve issue #66

@@ -26,7 +26,7 @@ public Task AppendToStream(string streamId, IEnumerable<StorageEvent> events, Ca

if (firstEvent.EventNumber - 1 != streams[streamId].Count)
{
throw new ConcurrencyException($"Concurrency conflict when appending to stream {streamId}. Expected revision {firstEvent.EventNumber} : Actual revision {streams[streamId].Count}");
throw new ConcurrencyException($"Concurrency conflict when appending to stream {streamId}. Expected revision {firstEvent.EventNumber - 1}");
Copy link
Author

Choose a reason for hiding this comment

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

Ideally the expected version should be passed into the method so we aren't expecting each storage engine to query the first event number - 1. However, this would be a breaking change to the API, so this will be done as part of a subsequent PR.

@asosMikeGore asosMikeGore merged commit b161152 into master Aug 9, 2021
@asos-chrisnewark asos-chrisnewark deleted the improve-error-messages branch March 1, 2023 14:48
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