Skip to content

Commit dbfdce6

Browse files
committed
v1.30.3
1 parent 1372a30 commit dbfdce6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
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-cli",
3-
"version": "1.30.2",
3+
"version": "1.30.3",
44
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
55
"main": "index.js",
66
"bin": {

src/api.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ async function query(url, options) {
6666
try {
6767
json = JSON.parse(text);
6868
} catch (e) {
69-
throw new Error(`Server error: ${text}`);
69+
if (resp.statusText.includes('Unauthorized')) {
70+
throw new Error('登录信息已过期,请使用 pushy login 命令重新登录');
71+
} else {
72+
throw new Error(`Server error: ${resp.statusText}`);
73+
}
7074
}
7175

7276
if (resp.status !== 200) {
@@ -166,7 +170,7 @@ export async function uploadFile(fn, key) {
166170
}
167171
if (resp.statusCode > 299) {
168172
return reject(
169-
Object.assign(new Error(JSON.stringify(body)), {
173+
Object.assign(new Error(body), {
170174
status: resp.statusCode,
171175
}),
172176
);

0 commit comments

Comments
 (0)