Skip to content

CSHARP-5007: Better error when no matching constructor found #406

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2024

Conversation

alkampfergit
Copy link
Contributor

@alkampfergit alkampfergit commented Aug 14, 2020

When you have a class in a hierarchy of classes that has no suitable constructor to be desrialized (look also at CSHARP-3186), I got a simple error

An error occurred while deserializing the Nodes property of class xxx.xxxx.ReportDocumentConfigurationValueObject: No matching creator found

The problem is that nodes property of that class can have like 10 concrete classes, and the error is on one specific class. With this patch the error contains the exact class that miss the constructor. This will surely speed up the diagnose of errors.

@adelinowona adelinowona self-requested a review February 9, 2024 03:37
@adelinowona adelinowona removed their request for review February 20, 2024 18:10
@sanych-sun sanych-sun self-requested a review March 8, 2024 00:15
@alkampfergit alkampfergit requested a review from a team as a code owner March 14, 2024 18:30
@sanych-sun sanych-sun changed the title Fix: Better error when no constructor found CSHARP-5007: Better error when no matching constructor found Mar 14, 2024
@sanych-sun sanych-sun removed the request for review from a team March 14, 2024 18:43
@sanych-sun sanych-sun merged commit 19e0715 into mongodb:master Mar 14, 2024
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.

3 participants