@vortexm/vjt 0.1.16 → 0.1.17
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/index.js +14 -2
- package/package.json +1 -1
- package/vjt-styles.css +6 -0
package/dist/index.js
CHANGED
|
@@ -4281,7 +4281,18 @@ var NetworkRuntime = class {
|
|
|
4281
4281
|
}
|
|
4282
4282
|
const contentType = response.headers.get("content-type") ?? "";
|
|
4283
4283
|
if (!contentType.toLowerCase().includes("text/event-stream")) {
|
|
4284
|
-
|
|
4284
|
+
const previewText = await response.text().catch(() => "");
|
|
4285
|
+
const normalizedPreview = previewText.replaceAll(/\s+/g, " ").trim().slice(0, 240);
|
|
4286
|
+
const error = new Error(`SSE response has unexpected content-type: ${contentType || "<empty>"}`);
|
|
4287
|
+
error.sseDetails = {
|
|
4288
|
+
status: response.status,
|
|
4289
|
+
statusText: response.statusText,
|
|
4290
|
+
responseUrl: response.url,
|
|
4291
|
+
redirected: response.redirected,
|
|
4292
|
+
contentType,
|
|
4293
|
+
bodyPreview: normalizedPreview
|
|
4294
|
+
};
|
|
4295
|
+
throw error;
|
|
4285
4296
|
}
|
|
4286
4297
|
logRuntimeDebug(this.debugLogging, "sse-open", {
|
|
4287
4298
|
url: safeUrl,
|
|
@@ -4335,7 +4346,8 @@ var NetworkRuntime = class {
|
|
|
4335
4346
|
reconnectReason = error instanceof Error ? error.message : "stream-error";
|
|
4336
4347
|
logRuntimeError("sseConnection", error, {
|
|
4337
4348
|
url: safeUrl,
|
|
4338
|
-
transport: "fetch"
|
|
4349
|
+
transport: "fetch",
|
|
4350
|
+
...typeof error === "object" && error !== null && "sseDetails" in error ? { response: error.sseDetails } : {}
|
|
4339
4351
|
});
|
|
4340
4352
|
} finally {
|
|
4341
4353
|
activeAbortController = null;
|
package/package.json
CHANGED
package/vjt-styles.css
CHANGED