Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit 6f5a199

Browse files
authored
Merge pull request #3 from PM-Connect/improvements
Improvements
2 parents 6925d18 + 2f12f42 commit 6f5a199

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

mixpanel.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ func (m *mixpanel) send(eventType string, params interface{}, autoGeolocate bool
228228
json.Unmarshal(body, &jsonBody)
229229

230230
if jsonBody.Status != 1 {
231-
return wrapErr(&ErrTrackFailed{Message: jsonBody.Error})
231+
errMsg := fmt.Sprintf("error=%s; status=%d; httpCode=%d", jsonBody.Error, jsonBody.Status, resp.StatusCode)
232+
return wrapErr(&ErrTrackFailed{Message: errMsg})
232233
}
233234

234235
return nil

mock.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ func (m *Mock) Update(distinctId string, u *Update) error {
104104
}
105105

106106
switch u.Operation {
107-
case "$set":
107+
case "$set", "$set_once":
108108
for key, val := range u.Properties {
109109
p.Properties[key] = val
110110
}
111111
default:
112-
return errors.New("mixpanel.Mock only supports the $set operation")
112+
return errors.New("mixpanel.Mock only supports the $set and $set_once operations")
113113
}
114114

115115
return nil

0 commit comments

Comments
 (0)