From 89828cc28a35d4fd3af3d1a2a2304d4fdf1b75c0 Mon Sep 17 00:00:00 2001 From: Prathyush PV Date: Thu, 9 Jan 2025 15:36:23 -0800 Subject: [PATCH] Do not print error when reading tasks from an empty dlq using tdbg --- tools/tdbg/dlq_v2_service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/tdbg/dlq_v2_service.go b/tools/tdbg/dlq_v2_service.go index 80644765dd6..4fc1bad18cd 100644 --- a/tools/tdbg/dlq_v2_service.go +++ b/tools/tdbg/dlq_v2_service.go @@ -193,6 +193,10 @@ func (ac *DLQV2Service) ReadMessages(c *cli.Context) (err error) { } res, err := adminClient.GetDLQTasks(ctx, request) if err != nil { + // If the DLQ does not exist yet, it's effectively empty, so we can safely return without an error. + if strings.Contains(err.Error(), "queue not found:") { + return nil, nil, nil + } return nil, nil, fmt.Errorf("call to GetDLQTasks from ReadMessages failed: %w", err) } return res.DlqTasks, res.NextPageToken, nil