Skip to content

Commit b5ed596

Browse files
committed
add specific error message when response.statusCode === 0
1 parent 1621e61 commit b5ed596

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/feedback/src/core/sendFeedback.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,13 @@ export async function sendFeedback(
7373
);
7474
}
7575

76-
// TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore
77-
if (!response) {
78-
throw new Error('Unable to send Feedback');
79-
}
80-
8176
// Require valid status codes, otherwise can assume feedback was not sent successfully
8277
if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) {
78+
if (response.statusCode === 0) {
79+
throw new Error(
80+
'Unable to send Feedback. This is because of network issues, or because you are using an ad-blocker.',
81+
);
82+
}
8383
throw new Error('Unable to send Feedback. Invalid response from server.');
8484
}
8585

0 commit comments

Comments
 (0)