Skip to content

Commit

Permalink
Fix return default event if no config
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieSinn committed Apr 29, 2024
1 parent e299e6c commit 481d069
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"context"
"errors"
"fmt"
"github.com/devcyclehq/go-server-sdk/v2/bucketing"
"io"
"math"
"math/rand"
Expand Down Expand Up @@ -305,7 +306,7 @@ func (c *Client) Variable(userdata User, key string, defaultValue interface{}) (
if !c.hasConfig() {
util.Warnf("Variable called before client initialized, returning default value")

err = c.eventQueue.QueueVariableDefaultedEvent(key, "NO CONFIG")
err = c.eventQueue.QueueVariableDefaultedEvent(key, bucketing.BucketResultErrorToDefaultReason(bucketing.ErrConfigMissing))
if err != nil {
util.Warnf("Error queuing aggregate event: ", err)
}
Expand Down

0 comments on commit 481d069

Please sign in to comment.