Improve error message

pull/21383/head
James Newton-King 5 years ago
parent 1fec449ee9
commit 8b740047c9
No known key found for this signature in database
GPG Key ID: A66B2F456BF5526
  1. 2
      src/csharp/Grpc.Core.Api/ChannelCredentials.cs
  2. 2
      src/csharp/Grpc.Core.Tests/ChannelCredentialsTest.cs

@ -104,7 +104,7 @@ namespace Grpc.Core
if (!channelCredentials.IsComposable)
{
throw new ArgumentException(string.Format("{0} can't be composed with supplied CallCredentials. Secure credentials like SslCredentials must be used.", channelCredentials.GetType().Name));
throw new ArgumentException(string.Format("CallCredentials can't be composed with {0}. CallCredentials must be used with secure channel credentials like SslCredentials.", channelCredentials.GetType().Name));
}
}

@ -41,7 +41,7 @@ namespace Grpc.Core.Tests
// forbid composing non-composable
var ex = Assert.Throws(typeof(ArgumentException), () => ChannelCredentials.Create(new FakeChannelCredentials(false), new FakeCallCredentials()));
Assert.AreEqual("FakeChannelCredentials can't be composed with supplied CallCredentials. Secure credentials like SslCredentials must be used.", ex.Message);
Assert.AreEqual("CallCredentials can't be composed with FakeChannelCredentials. CallCredentials must be used with secure channel credentials like SslCredentials.", ex.Message);
}
[Test]

Loading…
Cancel
Save