From f27e19a3e1a85864783c10e3c8f5ca2d56618323 Mon Sep 17 00:00:00 2001 From: Artem Skriabin Date: Tue, 5 Mar 2024 13:41:50 +0200 Subject: [PATCH] Add current and received session ID to error during receive --- internal/core/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/core/main.go b/internal/core/main.go index 8fe7308..5fad7d4 100644 --- a/internal/core/main.go +++ b/internal/core/main.go @@ -3,6 +3,8 @@ package core import ( "context" goerr "errors" + "gitlab.com/distributed_lab/logan/v3" + "gitlab.com/distributed_lab/logan/v3/errors" "sync" "github.com/rarimo/tss-svc/pkg/types" @@ -51,7 +53,10 @@ func (s *SessionManager) Receive(ctx context.Context, request *types.MsgSubmitRe return session.Receive(ctx, request) } - return ErrInvalidSessionID + return errors.From(ErrInvalidSessionID, logan.F{ + "current_id": session.ID(), + "received_id": request.Data.Id, + }) } return ErrInvalidSessionType