Skip to content

Commit 1fdd1d1

Browse files
committed
chore: propagate errors to response
1 parent d8b8ee5 commit 1fdd1d1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/utils/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ const request = async<T = unknown>(
6565
console.error(`Timing: ${Date.now()-start}ms
6666
(attempt ${attempt+1})`);
6767
}
68+
const brd_error = res.headers.get('x-brd-error')
69+
|| res.headers.get('x-luminati-error');
70+
if (brd_error)
71+
throw new Error(`Error: ${brd_error}`);
6872
if (res.ok)
6973
{
7074
if (opts.raw_buffer)

0 commit comments

Comments
 (0)