Skip to content

Commit 0446fc7

Browse files
0x2b3bfa0dacbd
andauthored
Only send error type for analytics (#704)
* Exclude error from successful analytics * Update iterative/utils/analytics.go Co-authored-by: Helio Machado <0x2b3bfa0+git@googlemail.com> Co-authored-by: Daniel Barnes <dabarnes2b@gmail.com>
1 parent 27ca85f commit 0446fc7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

iterative/utils/analytics.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,6 @@ func ResourceData(d *schema.ResourceData) map[string]interface{} {
316316
func JitsuEventPayload(action string, e error, extra map[string]interface{}) (map[string]interface{}, error) {
317317
systemInfo := SystemInfo()
318318

319-
err := ""
320-
if e != nil {
321-
err = reflect.TypeOf(e).String()
322-
}
323-
324319
userId, uErr := UserId()
325320
if uErr != nil {
326321
return nil, uErr
@@ -350,10 +345,14 @@ func JitsuEventPayload(action string, e error, extra map[string]interface{}) (ma
350345
"os_name": systemInfo["os_name"],
351346
"os_version": systemInfo["platform_version"],
352347
"backend": extra["cloud"],
353-
"error": err,
354348
"extra": extra,
355349
}
356350

351+
if e != nil {
352+
// Get the type of the error as a string, but not the error message itself, because it can be sensitive.
353+
payload["error"] = reflect.TypeOf(e).String()
354+
}
355+
357356
return payload, nil
358357
}
359358

0 commit comments

Comments
 (0)