Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ExceptionTransform for EventStreamUnexpectedMaxEventId and arch…
Browse files Browse the repository at this point in the history
…ived stream partitioning
ericgreenmix committed Oct 28, 2024
1 parent 7822459 commit 5c86817
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -11,6 +11,10 @@ internal class EventStreamUnexpectedMaxEventIdExceptionTransform: IExceptionTran
{
private const string ExpectedMessage =
"duplicate key value violates unique constraint \"pk_mt_events_stream_and_version\"";

private const string ExpectedMessageForArchivedStreamParitioning =
"duplicate key value violates unique constraint \"mt_events_default_stream_id_version_is_archived_idx\"";

private const string DetailsRedactedMessage = "Detail redacted as it may contain sensitive data. " +
"Specify 'Include Error Detail' in the connection string to include this information.";

@@ -69,6 +73,6 @@ private static bool Matches(Exception e)
{
return e is PostgresException pe
&& pe.SqlState == PostgresErrorCodes.UniqueViolation
&& pe.Message.Contains(ExpectedMessage);
&& (pe.Message.Contains(ExpectedMessage) || pe.Message.Contains(ExpectedMessageForArchivedStreamParitioning));
}
}

0 comments on commit 5c86817

Please sign in to comment.