diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-05 20:18:16 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-05 20:18:16 -0500 |
commit | f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da (patch) | |
tree | 260fa7579e1c361283bda09c2616783c3fdb5b9a /src/SMAPI/Framework/Reflection/ReflectedMethod.cs | |
parent | d34f369d35290bca96cc7225d9765d1a8a66fa8b (diff) | |
parent | 48959375b9ef52abf7c7a9404d43aac6ba780047 (diff) | |
download | SMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.tar.gz SMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.tar.bz2 SMAPI-f976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/Reflection/ReflectedMethod.cs')
-rw-r--r-- | src/SMAPI/Framework/Reflection/ReflectedMethod.cs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Reflection/ReflectedMethod.cs b/src/SMAPI/Framework/Reflection/ReflectedMethod.cs index 039f27c3..82737a7f 100644 --- a/src/SMAPI/Framework/Reflection/ReflectedMethod.cs +++ b/src/SMAPI/Framework/Reflection/ReflectedMethod.cs @@ -65,6 +65,10 @@ namespace StardewModdingAPI.Framework.Reflection { result = this.MethodInfo.Invoke(this.Parent, arguments); } + catch (TargetParameterCountException) + { + throw new Exception($"Couldn't invoke the {this.DisplayName} method: it expects {this.MethodInfo.GetParameters().Length} parameters, but {arguments.Length} were provided."); + } catch (Exception ex) { throw new Exception($"Couldn't invoke the {this.DisplayName} method", ex); |