Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,14 @@ function _checkForCannotReadResponseBody({
function _tryReadBody(r: Request | Response): Promise<string> {
// there are now already multiple places where we're using Promise...
// eslint-disable-next-line compat/compat
return new Promise((resolve, reject) => {
return new Promise((resolve) => {
const timeout = setTimeout(() => resolve('[SessionReplay] Timeout while trying to read body'), 500)
try {
r.clone()
.text()
.then(
(txt) => resolve(txt),
(reason) => reject(reason)
(reason) => resolve('[SessionReplay] Failed to read body: ' + reason)
)
.finally(() => clearTimeout(timeout))
} catch {
Expand Down
Loading