Skip to content

Commit f8a29a3

Browse files
committed
Cleaning up code and removing noisy caller tag
1 parent cc47b9a commit f8a29a3

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

Sources/Segment/Errors.swift

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,11 @@ extension Analytics {
7373
if fatal {
7474
exceptionFailure("A critical error occurred: \(translatedError)")
7575
}
76-
Telemetry.shared.error(metric: Telemetry.INVOKE_ERROR_METRIC, log: Thread.callStackSymbols.joined(separator: "\n")) {
77-
(_ it: inout [String: String]) in
78-
it["error"] = "\(translatedError)"
79-
it["writekey"] = configuration.values.writeKey
80-
it["caller"] = Thread.callStackSymbols[3]
81-
}
76+
Telemetry.shared.error(metric: Telemetry.INVOKE_ERROR_METRIC, log: Thread.callStackSymbols.joined(separator: "\n")) {
77+
(_ it: inout [String: String]) in
78+
it["error"] = "\(translatedError)"
79+
it["writekey"] = configuration.values.writeKey
80+
}
8281
}
8382

8483
static public func reportInternalError(_ error: Error, fatal: Bool = false) {
@@ -90,9 +89,8 @@ extension Analytics {
9089
exceptionFailure("A critical error occurred: \(translatedError)")
9190
}
9291
Telemetry.shared.error(metric: Telemetry.INVOKE_ERROR_METRIC, log: Thread.callStackSymbols.joined(separator: "\n")) {
93-
(_ it: inout [String: String]) in
94-
it["error"] = "\(translatedError)"
95-
it["caller"] = Thread.callStackSymbols[3]
96-
}
92+
(_ it: inout [String: String]) in
93+
it["error"] = "\(translatedError)"
94+
}
9795
}
9896
}

Sources/Segment/Utilities/Telemetry.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ public class Telemetry: Subscriber {
8686
internal var queue = [RemoteMetric]()
8787
private var queueBytes = 0
8888
private var queueSizeExceeded = false
89-
private var seenErrors = [String: Int]()
9089
internal var started = false
9190
private var rateLimitEndTime: TimeInterval = 0
9291
internal var flushFirstError = true
@@ -118,7 +117,6 @@ public class Telemetry: Subscriber {
118117
func reset() {
119118
telemetryTimer?.suspend()
120119
resetQueue()
121-
seenErrors.removeAll()
122120
started = false
123121
rateLimitEndTime = 0
124122
}

0 commit comments

Comments
 (0)