mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-28 03:00:29 -04:00
reject promise correctly
This commit is contained in:
@@ -988,6 +988,11 @@ export function secureFetchWithPinnedIP(
|
||||
const chunks: Buffer[] = []
|
||||
|
||||
res.on('data', (chunk: Buffer) => chunks.push(chunk))
|
||||
|
||||
res.on('error', (error) => {
|
||||
reject(error)
|
||||
})
|
||||
|
||||
res.on('end', () => {
|
||||
const bodyBuffer = Buffer.concat(chunks)
|
||||
const body = bodyBuffer.toString('utf-8')
|
||||
|
||||
Reference in New Issue
Block a user