mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Defensively handle text() failure in flush warnings
Co-Authored-By: Konstantin Wohlwend <n2d4xc@gmail.com>
This commit is contained in:
parent
8706f61350
commit
ee3e822b17
@ -290,7 +290,8 @@ export class EventTracker {
|
||||
}
|
||||
|
||||
if (!res.data.ok) {
|
||||
captureWarning("EventTracker.flush()", new Error(`EventTracker flush failed: ${res.data.status} ${await res.data.text()}`));
|
||||
const body = await res.data.text().catch(() => "<unable to read response body>");
|
||||
captureWarning("EventTracker.flush()", new Error(`EventTracker flush failed: ${res.data.status} ${body}`));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -261,7 +261,8 @@ export class SessionRecorder {
|
||||
}
|
||||
|
||||
if (!res.data.ok) {
|
||||
captureWarning("SessionRecorder.flush()", new Error(`SessionRecorder flush failed: ${res.data.status} ${await res.data.text()}`));
|
||||
const body = await res.data.text().catch(() => "<unable to read response body>");
|
||||
captureWarning("SessionRecorder.flush()", new Error(`SessionRecorder flush failed: ${res.data.status} ${body}`));
|
||||
}
|
||||
} finally {
|
||||
this._flushInProgress = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user