Skip to content

Commit

Permalink
Improve exception info when users share types between sagas (#703) (#930
Browse files Browse the repository at this point in the history
)

Co-authored-by: Ramon Smits <ramon.smits@gmail.com>
  • Loading branch information
soujay and ramonsmits authored Dec 26, 2022
1 parent f0dcc8e commit 57295f2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/NServiceBus.NHibernate/SagaPersisters/SagaModelMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,15 @@ public static List<string> AddMappings(Configuration configuration, SagaMetadata
idx.AddColumns(foreignKey.ColumnIterator);
idx.Name = "IDX" + foreignKey.Name.Substring(2);
idx.Table = table;
table.AddIndex(idx);

try
{
table.AddIndex(idx);
}
catch (MappingException e)
{
throw new Exception("Failed to add index! Are your sagas sharing types?", e);
}
}
}

Expand Down

0 comments on commit 57295f2

Please sign in to comment.