Skip to content

Commit 7a9f579

Browse files
committed
fix ping
1 parent 350bfa0 commit 7a9f579

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update",
3-
"version": "10.27.0",
3+
"version": "10.27.1",
44
"description": "react-native hot update",
55
"main": "src/index",
66
"scripts": {

src/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ const ping =
4949
return url;
5050
}
5151
log('ping failed', url, status, statusText);
52-
return null;
52+
throw new Error('Ping failed');
5353
})
5454
.catch(e => {
5555
pingFinished = true;
5656
log('ping error', url, e);
57-
return null;
57+
throw e;
5858
}),
59-
new Promise(r =>
59+
new Promise((_, reject) =>
6060
setTimeout(() => {
61-
r(null);
61+
reject(new Error('Ping timeout'));
6262
if (!pingFinished) {
6363
log('ping timeout', url);
6464
}

0 commit comments

Comments
 (0)