@rheonic/sdk 0.1.0-beta.12 → 0.1.0-beta.13
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/dist/eventBuilder.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ export function instrumentAnthropic(anthropicClient, options) {
|
|
|
92
92
|
response: {
|
|
93
93
|
latency_ms: Date.now() - startedAt,
|
|
94
94
|
error_type: extractErrorType(error),
|
|
95
|
+
error_message: extractErrorMessage(error),
|
|
95
96
|
http_status: extractHttpStatus(error),
|
|
96
97
|
},
|
|
97
98
|
}));
|
|
@@ -147,6 +148,15 @@ function extractErrorType(error) {
|
|
|
147
148
|
}
|
|
148
149
|
return "unknown";
|
|
149
150
|
}
|
|
151
|
+
function extractErrorMessage(error) {
|
|
152
|
+
if (error && typeof error === "object" && "message" in error) {
|
|
153
|
+
const message = error.message;
|
|
154
|
+
if (typeof message === "string" && message.length > 0) {
|
|
155
|
+
return message;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
150
160
|
function extractHttpStatus(error) {
|
|
151
161
|
if (!error || typeof error !== "object") {
|
|
152
162
|
return undefined;
|
|
@@ -92,6 +92,7 @@ export function instrumentGoogle(googleModel, options) {
|
|
|
92
92
|
response: {
|
|
93
93
|
latency_ms: Date.now() - startedAt,
|
|
94
94
|
error_type: extractErrorType(error),
|
|
95
|
+
error_message: extractErrorMessage(error),
|
|
95
96
|
http_status: extractHttpStatus(error),
|
|
96
97
|
},
|
|
97
98
|
}));
|
|
@@ -221,6 +222,15 @@ function extractErrorType(error) {
|
|
|
221
222
|
}
|
|
222
223
|
return "unknown";
|
|
223
224
|
}
|
|
225
|
+
function extractErrorMessage(error) {
|
|
226
|
+
if (error && typeof error === "object" && "message" in error) {
|
|
227
|
+
const message = error.message;
|
|
228
|
+
if (typeof message === "string" && message.length > 0) {
|
|
229
|
+
return message;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return undefined;
|
|
233
|
+
}
|
|
224
234
|
function extractHttpStatus(error) {
|
|
225
235
|
if (!error || typeof error !== "object") {
|
|
226
236
|
return undefined;
|
|
@@ -91,6 +91,7 @@ export function instrumentOpenAI(openaiClient, options) {
|
|
|
91
91
|
response: {
|
|
92
92
|
latency_ms: Date.now() - startedAt,
|
|
93
93
|
error_type: extractErrorType(error),
|
|
94
|
+
error_message: extractErrorMessage(error),
|
|
94
95
|
http_status: extractHttpStatus(error),
|
|
95
96
|
},
|
|
96
97
|
}));
|
|
@@ -196,6 +197,15 @@ function extractErrorType(error) {
|
|
|
196
197
|
}
|
|
197
198
|
return "unknown";
|
|
198
199
|
}
|
|
200
|
+
function extractErrorMessage(error) {
|
|
201
|
+
if (error && typeof error === "object" && "message" in error) {
|
|
202
|
+
const message = error.message;
|
|
203
|
+
if (typeof message === "string" && message.length > 0) {
|
|
204
|
+
return message;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return undefined;
|
|
208
|
+
}
|
|
199
209
|
function extractHttpStatus(error) {
|
|
200
210
|
if (!error || typeof error !== "object") {
|
|
201
211
|
return undefined;
|
package/package.json
CHANGED