Skip to content

Commit

Permalink
Print expression when throwing null type mapping in SQL tree
Browse files Browse the repository at this point in the history
Part of #7201
  • Loading branch information
smitpatel committed Sep 1, 2020
1 parent 78cdc71 commit 9aaec85
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
8 changes: 5 additions & 3 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.

2 changes: 1 addition & 1 deletion src/EFCore.Cosmos/Properties/CosmosStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
<value>There is no string-based representation of this query as it's executed using 'ReadItemQueryAsync({resourceId}, {partitionKey})'.</value>
</data>
<data name="NullTypeMappingInSqlTree" xml:space="preserve">
<value>Null TypeMapping in Sql Tree.</value>
<value>Expression '{sqlExpression}' in SQL tree does not have type mapping assigned.</value>
</data>
<data name="OffsetRequiresLimit" xml:space="preserve">
<value>Offset is not supported without Limit.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ protected override Expression VisitExtension(Expression extensionExpression)
if (extensionExpression is SqlExpression sqlExpression
&& sqlExpression.TypeMapping == null)
{
throw new InvalidOperationException(CosmosStrings.NullTypeMappingInSqlTree);
throw new InvalidOperationException(CosmosStrings.NullTypeMappingInSqlTree(sqlExpression.Print()));
}

return base.VisitExtension(extensionExpression);
Expand Down
12 changes: 8 additions & 4 deletions src/EFCore.Relational/Properties/RelationalStrings.Designer.cs

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

2 changes: 1 addition & 1 deletion src/EFCore.Relational/Properties/RelationalStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@
<value>Nullability information should only be specified for scalar database functions.</value>
</data>
<data name="NullTypeMappingInSqlTree" xml:space="preserve">
<value>Null TypeMapping in Sql Tree.</value>
<value>Expression '{sqlExpression}' in SQL tree does not have type mapping assigned.</value>
</data>
<data name="ParameterNotObjectArray" xml:space="preserve">
<value>Cannot use the value provided for parameter '{parameter}' because it isn't assignable to type object[].</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ protected override Expression VisitExtension(Expression extensionExpression)
{
if (sqlExpression.TypeMapping == null)
{
throw new InvalidOperationException(RelationalStrings.NullTypeMappingInSqlTree);
throw new InvalidOperationException(RelationalStrings.NullTypeMappingInSqlTree(sqlExpression.Print()));
}
}

Expand Down

0 comments on commit 9aaec85

Please sign in to comment.