Skip to content
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

Added guard to throw InvalidOperrationException. #95723

Closed
wants to merge 1 commit into from

Commits on Dec 7, 2023

  1. Added guard to throw InvalidOperrationException.

    Added guard to throw InvalidOperrationException if the argument typeToConvert and Converter are incompatible.
    The exception message is "Type 'NameOfType' is not compatible with converter 'ConverterName'." and "Type 'NameOfType' is not compatible with converter 'ConverterName'.
    
    NOTES:
    The test threw a NotSupportedException on the following line and could not reproduce this issue, so the JsonSerializerOptions instantiation was changed.
    OptionsTests.ConverterRead_VerifyInvalidTypeToConvertFails() lineno 1432
    KeyValuePair<int, int> kvp = converter.Read(ref reader, typeToConvert, options);
    
    Fix dotnet#36605
    rhirano0715 committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    1148958 View commit details
    Browse the repository at this point in the history