Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Commit

Permalink
feat: 缩短错误时输出内容长度
Browse files Browse the repository at this point in the history
  • Loading branch information
catlair committed Jun 19, 2021
1 parent bb39524 commit d7f13ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/dailyTask/liveTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Live {
}
logger.info('所有直播弹幕发送成功');
} catch (error) {
logger.error('发生异常', error);
logger.error('发生异常', error.message);
}
//此处调用是怕整个过程并没有运行签到
await liveSign(this.page);
Expand Down Expand Up @@ -89,7 +89,7 @@ class Live {
await this.closeLiveRoom();
} catch (error) {
const { target_name, medalName } = this.fansMedalList[this.index];
logger.warn('发送弹幕时出错', target_name, medalName, error);
logger.warn('发送弹幕时出错', target_name, medalName, error.message);
}
}

Expand Down Expand Up @@ -130,7 +130,7 @@ class Live {
try {
await getMedal();
} catch (error) {
logger.debug('获取下一页出现错误', error);
logger.debug('获取下一页出现错误', error.message);
await getMedal();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dailyTask/playVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export default async function playVideo(page: Page, logger?: Logger) {
const $video = await page.$('video');
await $video.click();
} catch (e) {
logger.error('环境不支持点击视频', e);
logger.error('环境不支持点击视频', e.message);
}
}
2 changes: 1 addition & 1 deletion src/dailyTask/shareVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default async function shareVideo(
logger.info('成功分享视频');
DailyTask.isShare = true;
} catch (error) {
logger.error('分享视频失败', error);
logger.error('分享视频失败', error.message);
} finally {
if (!sharePage.isClosed()) {
await sharePage.close();
Expand Down

0 comments on commit d7f13ed

Please sign in to comment.