From 138eedd59fc646ef92e4383868cbd7199d8ea7d3 Mon Sep 17 00:00:00 2001 From: Artem Muterko Date: Sun, 1 Mar 2026 13:38:36 +0100 Subject: [PATCH] Fix error wrapping in Matrix provider Use %w instead of %s in fmt.Errorf so the underlying error can be unwrapped with errors.Is/errors.As. Signed-off-by: Ioannis Polyzos Signed-off-by: Artem Muterko --- internal/notifier/matrix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/notifier/matrix.go b/internal/notifier/matrix.go index 07eabc098..de174040b 100644 --- a/internal/notifier/matrix.go +++ b/internal/notifier/matrix.go @@ -43,7 +43,7 @@ func NewMatrix(serverURL, token, roomId string, tlsConfig *tls.Config) (*Matrix, func (m *Matrix) Post(ctx context.Context, event eventv1.Event) error { txId, err := sha1sum(event) if err != nil { - return fmt.Errorf("unable to generate unique tx id: %s", err) + return fmt.Errorf("unable to generate unique tx id: %w", err) } fullURL := fmt.Sprintf("%s/_matrix/client/r0/rooms/%s/send/m.room.message/%s", m.URL, m.RoomId, txId)