Skip to content

Commit 80f9a09

Browse files
committed
log stacktrace for more tracing
1 parent 8ff21de commit 80f9a09

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/NetCoreKit.Infrastructure.GrpcHost/AuthInterceptor.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public override async Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TR
5050

5151
if (_config.GetSection("Idp") == null)
5252
{
53-
throw new Exception("Provide bearer token in the header.");
53+
throw new Exception("Provide Idp configuration section in appsettings.json.");
5454
}
5555

5656
var client = new HttpClient();
@@ -91,7 +91,7 @@ public override async Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TR
9191

9292
if (string.IsNullOrEmpty(userToken))
9393
{
94-
throw new AuthenticationException("Cannot get authorization on the header");
94+
throw new AuthenticationException("Cannot get authorization on the header.");
9595
}
9696

9797
var user = handler.ValidateToken(userToken.TrimStart("Bearer").TrimStart("bearer").TrimStart(" "), parameters, out _);
@@ -113,6 +113,7 @@ public override async Task<TResponse> UnaryServerHandler<TRequest, TResponse>(TR
113113
{
114114
// http://avi.im/grpc-errors
115115
_logger.LogError(ex.Message);
116+
_logger.LogError(ex.StackTrace);
116117
throw new RpcException(new Status(StatusCode.Unauthenticated, ex.Message));
117118
}
118119
}

0 commit comments

Comments
 (0)