diff options
author | 2018-01-16 15:56:41 +0100 | |
---|---|---|
committer | 2018-01-16 15:56:41 +0100 | |
commit | 4bba3187cbbeec368ecd1625359ab51834f4bf45 (patch) | |
tree | e8dbbe3125cfdf7861b1b7e91ab7e32d73719adc | |
parent | 69d3e0984da394d1ea06edbe26de76d124c6eaf3 (diff) |
better log message when auth interceptor throws
-rw-r--r-- | src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs b/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs index a8cb357181..4d695e8850 100644 --- a/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs +++ b/src/csharp/Grpc.Core/Internal/NativeMetadataCredentialsPlugin.cs @@ -27,7 +27,8 @@ namespace Grpc.Core.Internal internal class NativeMetadataCredentialsPlugin { - const string GetMetadataExceptionMsg = "Exception occured in metadata credentials plugin."; + const string GetMetadataExceptionStatusMsg = "Exception occurred in metadata credentials plugin."; + const string GetMetadataExceptionLogMsg = GetMetadataExceptionStatusMsg + " This is likely not a problem with gRPC itself. Please verify that the code supplying the metadata (usually an authentication token) works correctly."; static readonly ILogger Logger = GrpcEnvironment.Logger.ForType<NativeMetadataCredentialsPlugin>(); static readonly NativeMethods Native = NativeMethods.Get(); @@ -67,8 +68,8 @@ namespace Grpc.Core.Internal } catch (Exception e) { - Native.grpcsharp_metadata_credentials_notify_from_plugin(callbackPtr, userDataPtr, MetadataArraySafeHandle.Create(Metadata.Empty), StatusCode.Unknown, GetMetadataExceptionMsg); - Logger.Error(e, GetMetadataExceptionMsg); + Native.grpcsharp_metadata_credentials_notify_from_plugin(callbackPtr, userDataPtr, MetadataArraySafeHandle.Create(Metadata.Empty), StatusCode.Unknown, GetMetadataExceptionStatusMsg); + Logger.Error(e, GetMetadataExceptionLogMsg); } } @@ -86,8 +87,8 @@ namespace Grpc.Core.Internal } catch (Exception e) { - Native.grpcsharp_metadata_credentials_notify_from_plugin(callbackPtr, userDataPtr, MetadataArraySafeHandle.Create(Metadata.Empty), StatusCode.Unknown, GetMetadataExceptionMsg); - Logger.Error(e, GetMetadataExceptionMsg); + Native.grpcsharp_metadata_credentials_notify_from_plugin(callbackPtr, userDataPtr, MetadataArraySafeHandle.Create(Metadata.Empty), StatusCode.Unknown, GetMetadataExceptionStatusMsg); + Logger.Error(e, GetMetadataExceptionLogMsg); } } } |