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

Avoiding discarding exception details of MissingMethodException in RuntimeType.CreateInstanceImpl #108876

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4e2921b
Update RuntimeType.CoreCLR.cs (Should not trash the stack trace of `M…
Takym Oct 15, 2024
f512d99
Merge branch 'dotnet:main' into AvoidingDiscardingExceptionDetails/20…
Takym Oct 15, 2024
9b22861
Update RuntimeType.Mono.cs (Should not trash the stack trace of `Miss…
Takym Oct 15, 2024
419d8f6
Merge branch 'main' into AvoidingDiscardingExceptionDetails/2024_10
Takym Oct 15, 2024
8c83f90
Rethrow for modifying the message to include the method name certainl…
Takym Oct 17, 2024
ab24087
Fix RuntimeType.CoreCLR.cs (var scope mistake)
Takym Oct 17, 2024
72bf64f
Update RuntimeType.CoreCLR.cs
Takym Oct 17, 2024
87a9780
Rethrow for modifying the message to include the method name certainl…
Takym Oct 17, 2024
79f9749
Merge branch 'main' into AvoidingDiscardingExceptionDetails/2024_10
Takym Oct 17, 2024
aa86d82
Merge branch 'dotnet:main' into AvoidingDiscardingExceptionDetails/20…
Takym Oct 17, 2024
2a75ccf
Merge branch 'main' into AvoidingDiscardingExceptionDetails/2024_10
Takym Oct 18, 2024
40c463e
Update comments in `RuntimeType.CreateInstanceImpl`
Takym Oct 18, 2024
75b3c3a
Merge branch 'AvoidingDiscardingExceptionDetails/2024_10' of https://…
Takym Oct 18, 2024
e4a8824
Added a new test for RuntimeType.CreateInstanceImpl throws MissingMet…
Takym Oct 18, 2024
936a2bb
Update src/libraries/System.Runtime/tests/System.Runtime.Tests/System…
Takym Oct 18, 2024
cc148ce
Update src/libraries/System.Runtime/tests/System.Runtime.Tests/System…
Takym Oct 18, 2024
4ccbc9d
Merge branch 'main' into AvoidingDiscardingExceptionDetails/2024_10
Takym Oct 18, 2024
a9c94a8
Update src/libraries/System.Runtime/tests/System.Runtime.Tests/System…
Takym Oct 18, 2024
9e08d3d
Merge branch 'main' into AvoidingDiscardingExceptionDetails/2024_10
Takym Oct 18, 2024
1836b5d
Merge branch 'main' into AvoidingDiscardingExceptionDetails/2024_10
Takym Oct 19, 2024
28236f5
Merge branch 'main' into AvoidingDiscardingExceptionDetails/2024_10
Takym Oct 19, 2024
e4808c5
Fixed a tester bug (`ActivatorTests.CreateInstance_WithCustomBinder_T…
Takym Oct 20, 2024
8059876
Test more strictly (`ActivatorTests.CreateInstance_WithCustomBinder_T…
Takym Oct 20, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -3915,13 +3915,16 @@ private void CreateInstanceCheckThis()
}

MethodBase? invokeMethod;
object? state = null;
object? state;

try
{
invokeMethod = binder.BindToMethod(bindingAttr, cons, ref args, null, culture, null, out state);
}
catch (MissingMethodException) { invokeMethod = null; }
catch (MissingMethodException mme) // Should we catch all exceptions?
Takym marked this conversation as resolved.
Show resolved Hide resolved
{
throw new MissingMethodException(SR.Format(SR.MissingConstructor_Name, FullName), mme);
}

if (invokeMethod is null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1549,13 +1549,16 @@ private void CreateInstanceCheckThis()
}

MethodBase? invokeMethod;
object? state = null;
object? state;

try
{
invokeMethod = binder.BindToMethod(bindingAttr, cons, ref args, null, culture, null, out state);
}
catch (MissingMethodException) { invokeMethod = null; }
catch (MissingMethodException mme) // Should we catch all exceptions?
{
throw new MissingMethodException(SR.Format(SR.MissingConstructor_Name, FullName), mme);
}

if (invokeMethod == null)
{
Expand Down
Loading