Skip to content

Fix to #20612 - Throw helpful translation exception for String.Equals(String, StringComparison) - #20663

Merged
maumar merged 1 commit into
masterfrom
better_exceptions
May 13, 2020
Merged

maumar merged 1 commit into
masterfrom
better_exceptions

Conversation

@maumar

@maumar maumar commented Apr 16, 2020

Copy link
Copy Markdown
Contributor

Adding state to ExpressionTranslatingExpressionVisitor that stores the information about why translation failed. The information is bubbled up and added to the "translation failed" exception.
Currently only doing this for string.Equals and non-mapped member properties

@maumar
maumar requested review from roji and smitpatel April 16, 2020 22:09
@maumar
maumar force-pushed the better_exceptions branch from d60c77c to a9c4577 Compare April 16, 2020 22:13
Comment thread src/EFCore/Properties/CoreStrings.resx Resolved
Comment thread src/EFCore/Properties/CoreStrings.resx Resolved
Comment thread src/EFCore/Properties/CoreStrings.resx Resolved

@smitpatel smitpatel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a test where both the errors are happening in same expression so we see results of concatenation.
Also paste output of each error and combination in PR so we can see what exactly user will see.

@maumar
maumar force-pushed the better_exceptions branch from 75d4d6d to e7e740d Compare April 27, 2020 22:08
@maumar

maumar commented Apr 27, 2020

Copy link
Copy Markdown
Contributor Author

@smitpatel new version up

@maumar
maumar force-pushed the better_exceptions branch 2 times, most recently from 93acd74 to 326b684 Compare April 27, 2020 23:57
@maumar

maumar commented May 7, 2020

Copy link
Copy Markdown
Contributor Author

ping

@smitpatel

Copy link
Copy Markdown
Contributor

Rebase?

@maumar
maumar force-pushed the better_exceptions branch from 326b684 to d349425 Compare May 7, 2020 20:41
@maumar

maumar commented May 7, 2020

Copy link
Copy Markdown
Contributor Author

@smitpatel done

@JeremyLikness

Copy link
Copy Markdown
Member

@maumar here is a fwlink instead of aka.ms format (thanks @smitpatel) https://go.microsoft.com/fwlink/?linkid=2129535

@maumar
maumar force-pushed the better_exceptions branch from d349425 to e228277 Compare May 11, 2020 02:22
@maumar

maumar commented May 12, 2020

Copy link
Copy Markdown
Contributor Author

ready again @smitpatel

@smitpatel

Copy link
Copy Markdown
Contributor

Also add member not mapped for indexer properties.

@maumar
maumar force-pushed the better_exceptions branch from e228277 to 60ccd6e Compare May 12, 2020 18:02
@maumar
maumar force-pushed the better_exceptions branch from 60ccd6e to 5ca6ae4 Compare May 12, 2020 21:07
…(String, StringComparison)

Adding state to ExpressionTranslatingExpressionVisitor that stores the information about why translation failed. The information is bubbled up and added to the "translation failed" exception.
Currently only doing this for string.Equals and non-mapped member properties
@maumar
maumar force-pushed the better_exceptions branch from 5ca6ae4 to 9e0f05b Compare May 13, 2020 04:13
@maumar
maumar merged commit 9e0f05b into master May 13, 2020
@maumar
maumar deleted the better_exceptions branch May 13, 2020 05:11
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.

Throw helpful translation exception for String.Equals(String, StringComparison)

5 participants