From 26c33328975a61a1e4a3b07076aaba8fe29e76b3 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 24 Aug 2016 21:10:03 +0300 Subject: [PATCH] Better error message --- src/BenchmarkDotNet.Core/Running/BenchmarkConverter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BenchmarkDotNet.Core/Running/BenchmarkConverter.cs b/src/BenchmarkDotNet.Core/Running/BenchmarkConverter.cs index fea0ca702..1792aaa42 100644 --- a/src/BenchmarkDotNet.Core/Running/BenchmarkConverter.cs +++ b/src/BenchmarkDotNet.Core/Running/BenchmarkConverter.cs @@ -138,7 +138,7 @@ namespace BenchmarkDotNet.Running while (declaringType != null) { if (!declaringType.GetTypeInfo().IsPublic && !declaringType.GetTypeInfo().IsNestedPublic) - throw new InvalidOperationException($"{methodType} method {methodInfo.Name} defined within type {declaringType.FullName} has incorrect access modifiers.\nDeclaring type must be public."); + throw new InvalidOperationException($"{declaringType.FullName} containing {methodType} method {methodInfo.Name} has incorrect access modifiers.\nDeclaring type must be public."); declaringType = declaringType.DeclaringType; } @@ -150,4 +150,4 @@ namespace BenchmarkDotNet.Running throw new InvalidOperationException($"{methodType} method {methodInfo.Name} is generic.\nGeneric {methodType} methods are not supported."); } } -} \ No newline at end of file +}