Skip to content

Commit

Permalink
chore: downplay legitimate state not found errors
Browse files Browse the repository at this point in the history
  • Loading branch information
leg100 committed Jul 31, 2023
1 parent d70c7fd commit 2d91e31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/state/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ func (a *service) GetCurrentStateVersion(ctx context.Context, workspaceID string
}

sv, err := a.db.getCurrentVersion(ctx, workspaceID)
if err != nil {
if errors.Is(err, internal.ErrResourceNotFound) {
// not found error occurs legitimately with a new workspace without any
// state, so we log these errors at low level instead
a.V(3).Info("retrieving current state version: workspace has no state yet", "workspace_id", workspaceID, "subject", subject)
return nil, err
} else if err != nil {
a.Error(err, "retrieving current state version", "workspace_id", workspaceID, "subject", subject)
return nil, err
}
Expand Down

0 comments on commit 2d91e31

Please # to comment.