From afe30cf1c6c89a87a893152be68aa12945c56835 Mon Sep 17 00:00:00 2001 From: Aron Kerekes Date: Fri, 14 Nov 2025 15:11:47 +0100 Subject: [PATCH] fix: identity links Signed-off-by: Aron Kerekes --- docs/identity/identity_service_contributing.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/identity/identity_service_contributing.md b/docs/identity/identity_service_contributing.md index 6d0a739a..87c2fab1 100644 --- a/docs/identity/identity_service_contributing.md +++ b/docs/identity/identity_service_contributing.md @@ -244,7 +244,7 @@ Since only two types of errors are returned from the Application layer, error ha - If the error is a *domain error*, a [`status.Status`](https://pkg.go.dev/google.golang.org/grpc/status#Status) is returned with a code corresponding to the `DomainError.Reason` field. - If the error is a *technical error*, it is forwarded as-is. -Later, a custom gRPC interceptor [`ErrorInterceptor`](https://github.com/agntcy/identity-service/blob/main/backend/internal/pkg/interceptors/error.go) logs the error and returns a [`status.Status`](https://pkg.go.dev/google.golang.org/grpc/status#Status) with an `Internal` code as a response. +Later, a custom gRPC interceptor `ErrorInterceptor` logs the error and returns a [`status.Status`](https://pkg.go.dev/google.golang.org/grpc/status#Status) with an `Internal` code as a response. The helper function [`grpcutil.Error()`](https://github.com/agntcy/identity-service/blob/main/backend/internal/pkg/grpcutil/errors.go) encapsulates the error handling process described above and can be called from gRPC services, as shown in the following example: @@ -324,7 +324,7 @@ What log level to use? ## Error logging -In case an unexpected error happened and the execution flow needs to be stopped, **do not** log the error, there is a global gRPC interceptor [`ErrorInterceptor`](https://github.com/agntcy/identity-service/blob/main/backend/internal/pkg/interceptors/error.go) that catches these errors and logs them. +In case an unexpected error happened and the execution flow needs to be stopped, **do not** log the error, there is a global gRPC interceptor `ErrorInterceptor` that catches these errors and logs them. This prevents errors from being logged more than once, which facilitates tracing. ## Formats @@ -375,7 +375,7 @@ The context is propagated to the application and domain services, as well as to For example, repositories use the tenant ID from the context to filter data using the custom GORM scope [`BelongsToTenant`](https://github.com/agntcy/identity-service/blob/main/backend/internal/pkg/gormutil/scopes.go), while HTTP clients can use the context to cancel requests if the user closes the connection to the server. -The population of the `Context` with user and tenant metadata is managed by the [`AuthInterceptor`](https://github.com/agntcy/identity-service/blob/main/backend/internal/pkg/interceptors/auth.go) gRPC interceptor. +The population of the `Context` with user and tenant metadata is managed by the `AuthInterceptor` gRPC interceptor. # Database