snow-flow 10.0.202 → 10.0.203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -77,6 +77,7 @@ export namespace AnonymousTelemetry {
|
|
|
77
77
|
|
|
78
78
|
let messageCount = 0
|
|
79
79
|
let exitReason: "normal" | "error" | "interrupt" = "normal"
|
|
80
|
+
let exitErrorMessage: string | undefined
|
|
80
81
|
let configDisabled = false
|
|
81
82
|
const startTime = Date.now()
|
|
82
83
|
const sessionId = crypto.randomUUID()
|
|
@@ -89,8 +90,11 @@ export namespace AnonymousTelemetry {
|
|
|
89
90
|
]
|
|
90
91
|
|
|
91
92
|
// Track exit reason via process signals
|
|
92
|
-
const onError = () => {
|
|
93
|
+
const onError = (err: unknown) => {
|
|
93
94
|
exitReason = "error"
|
|
95
|
+
if (err instanceof Error) exitErrorMessage = `${err.name}: ${err.message}`.slice(0, 500)
|
|
96
|
+
else if (typeof err === "string") exitErrorMessage = err.slice(0, 500)
|
|
97
|
+
else exitErrorMessage = String(err).slice(0, 500)
|
|
94
98
|
}
|
|
95
99
|
const onInterrupt = () => {
|
|
96
100
|
exitReason = "interrupt"
|
|
@@ -142,6 +146,9 @@ export namespace AnonymousTelemetry {
|
|
|
142
146
|
get exitReason() {
|
|
143
147
|
return exitReason
|
|
144
148
|
},
|
|
149
|
+
get exitErrorMessage() {
|
|
150
|
+
return exitErrorMessage
|
|
151
|
+
},
|
|
145
152
|
get configDisabled() {
|
|
146
153
|
return configDisabled
|
|
147
154
|
},
|
|
@@ -165,6 +172,7 @@ export namespace AnonymousTelemetry {
|
|
|
165
172
|
...current.basePayload,
|
|
166
173
|
type: "end",
|
|
167
174
|
exitReason: current.exitReason,
|
|
175
|
+
exitErrorMessage: current.exitErrorMessage,
|
|
168
176
|
sessionDurationSec,
|
|
169
177
|
messageCount: current.messageCount,
|
|
170
178
|
timestamp: Date.now(),
|