Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions common/persistence/visibility/store/sql/visibility_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ package sql

import (
"context"
"errors"
"fmt"
"strings"
"time"
Expand All @@ -42,6 +43,7 @@ import (
"go.temporal.io/server/common/persistence/sql/sqlplugin"
"go.temporal.io/server/common/persistence/visibility/manager"
"go.temporal.io/server/common/persistence/visibility/store"
"go.temporal.io/server/common/persistence/visibility/store/query"
"go.temporal.io/server/common/resolver"
"go.temporal.io/server/common/searchattribute"
)
Expand Down Expand Up @@ -374,6 +376,11 @@ func (s *VisibilityStore) ListWorkflowExecutions(
)
selectFilter, err := converter.BuildSelectStmt(request.PageSize, request.NextPageToken)
if err != nil {
// Convert ConverterError to InvalidArgument and pass through all other errors (which should be only mapper errors).
var converterErr *query.ConverterError
if errors.As(err, &converterErr) {
return nil, converterErr.ToInvalidArgument()
}
return nil, err
}

Expand Down Expand Up @@ -447,6 +454,11 @@ func (s *VisibilityStore) CountWorkflowExecutions(
)
selectFilter, err := converter.BuildCountStmt()
if err != nil {
// Convert ConverterError to InvalidArgument and pass through all other errors (which should be only mapper errors).
var converterErr *query.ConverterError
if errors.As(err, &converterErr) {
return nil, converterErr.ToInvalidArgument()
}
return nil, err
}

Expand Down