Skip to content

Improve exception messages #23080

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
1 commit merged into from
Oct 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions src/EFCore.Cosmos/Properties/CosmosStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -148,25 +148,25 @@
<value>Navigation '{entityType}.{navigationName}' doesn't point to an embedded entity.</value>
</data>
<data name="NoDiscriminatorProperty" xml:space="preserve">
<value>The entity type '{entityType}' is sharing the container '{container}' with other types, but does not have a discriminator property configured.</value>
<value>The entity type '{entityType}' is sharing the container '{container}' with other types, but does not have a discriminator property configured. Configure a discriminator property and assign a unique value for this entity type.</value>
</data>
<data name="NoDiscriminatorValue" xml:space="preserve">
<value>The entity type '{entityType}' is sharing the container '{container}' with other types, but does not have a discriminator value configured.</value>
<value>The entity type '{entityType}' is sharing the container '{container}' with other types, but does not have a discriminator value configured. Configure a unique discriminator value for this entity type.</value>
</data>
<data name="NoIdKey" xml:space="preserve">
<value>The entity type '{entityType}' does not have a key declared on the '{idProperty}' property. Add a key to '{entityType}' that contains '{idProperty}'.</value>
</data>
<data name="NoIdProperty" xml:space="preserve">
<value>The entity type '{entityType}' does not have a property mapped to the 'id' property in the database. Add a property mapped as 'id'.</value>
<value>The entity type '{entityType}' does not have a property mapped to the 'id' property in the database. Add a property mapped to 'id'.</value>
</data>
<data name="NonEmbeddedIncludeNotSupported" xml:space="preserve">
<value>Including navigation '{navigation}' is not supported as the navigation is not embedded in same resource.</value>
</data>
<data name="NonETagConcurrencyToken" xml:space="preserve">
<value>The entity type '{entityType}' has property '{property}' as its concurrency token, but only '_etag' is supported. Consider using 'EntityTypeBuilder.UseETagConcurrency'.</value>
<value>The entity type '{entityType}' has property '{property}' configured as a concurrency token, but only a property mapped to '_etag' is supported as a concurrency token. Consider using 'PropertyBuilder.IsETagConcurrency'.</value>
</data>
<data name="NoPartitionKey" xml:space="preserve">
<value>The entity type '{entityType}' does not have a partition key set, but is mapped to the container '{container}' shared by entity types with partition keys. Configure a partition key on '{entityType}'.</value>
<value>The entity type '{entityType}' does not have a partition key set, but is mapped to the container '{container}' shared by entity types with partition keys. Configure a compatible partition key on '{entityType}'.</value>
</data>
<data name="NoPartitionKeyKey" xml:space="preserve">
<value>The entity type '{entityType}' does not have a key declared on '{partitionKey}' and '{idProperty}' properties. Add a key to '{entityType}' that contains '{partitionKey}' and '{idProperty}'.</value>
Expand All @@ -186,20 +186,20 @@
<data name="OrphanedNestedDocumentSensitive" xml:space="preserve">
<value>The entity of type '{entityType}' is mapped as part of the document mapped to '{missingEntityType}', but there is no tracked entity of this type with the key value '{keyValue}'.</value>
</data>
<data name="PartitionKeyMismatch" xml:space="preserve">
<value>The partition key specified in the 'WithPartitionKey' call '{partitionKey1}' and the partition key specified in the 'Where' predicate '{partitionKey2}' must be identical to return any results. Remove one of them.</value>
</data>
<data name="PartitionKeyMissing" xml:space="preserve">
<value>Unable to execute a 'ReadItem' query since the partition key value is missing. Consider using the 'WithPartitionKey' method on the query to specify partition key to use.</value>
</data>
<data name="PartitionKeyMismatch" xml:space="preserve">
<value>The partition key specified in the 'WithPartitionKey' call '{partitionKey1}' and the partition key specified in the 'Where' predicate '{partitionKey2}' must be identical. Remove one of them.</value>
</data>
<data name="PartitionKeyMissingProperty" xml:space="preserve">
<value>The partition key for entity type '{entityType}' is set to '{property}', but there is no property with that name.</value>
</data>
<data name="PartitionKeyNonStringStoreType" xml:space="preserve">
<value>The type of the partition key property '{property}' on '{entityType}' is '{propertyType}'. All partition key properties need to be strings or have a string value converter.</value>
</data>
<data name="PartitionKeyStoreNameMismatch" xml:space="preserve">
<value>The partition key property '{property1}' on '{entityType1}' is mapped as '{storeName1}', but the partition key property '{property2}' on '{entityType2}' is mapped as '{storeName2}'. All partition key properties need to be mapped to the same store property.</value>
<value>The partition key property '{property1}' on '{entityType1}' is mapped as '{storeName1}', but the partition key property '{property2}' on '{entityType2}' is mapped as '{storeName2}'. All partition key properties need to be mapped to the same store property for entity types mapped to the same container.</value>
</data>
<data name="ResourceIdMissing" xml:space="preserve">
<value>Unable to execute a 'ReadItem' query since the 'id' value is missing and cannot be generated.</value>
Expand All @@ -219,4 +219,4 @@
<data name="VisitChildrenMustBeOverridden" xml:space="preserve">
<value>'VisitChildren' must be overridden in the class deriving from 'SqlExpression'.</value>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public virtual RelationalOptionsExtension WithCommandTimeout(int? commandTimeout
if (commandTimeout.HasValue
&& commandTimeout <= 0)
{
throw new InvalidOperationException(RelationalStrings.InvalidCommandTimeout);
throw new InvalidOperationException(RelationalStrings.InvalidCommandTimeout(commandTimeout));
}

var clone = Clone();
Expand Down Expand Up @@ -172,7 +172,7 @@ public virtual RelationalOptionsExtension WithMaxBatchSize(int? maxBatchSize)
if (maxBatchSize.HasValue
&& maxBatchSize <= 0)
{
throw new InvalidOperationException(RelationalStrings.InvalidMaxBatchSize);
throw new InvalidOperationException(RelationalStrings.InvalidMaxBatchSize(maxBatchSize));
}

var clone = Clone();
Expand Down Expand Up @@ -200,7 +200,7 @@ public virtual RelationalOptionsExtension WithMinBatchSize(int? minBatchSize)
if (minBatchSize.HasValue
&& minBatchSize <= 0)
{
throw new InvalidOperationException(RelationalStrings.InvalidMinBatchSize);
throw new InvalidOperationException(RelationalStrings.InvalidMinBatchSize(minBatchSize));
}

var clone = Clone();
Expand Down
Loading