收口微信九宫切图诊断日志
微信九宫切图失败日志改为固定阶段标签 原生壳门禁拒绝九宫切图日志输出原生错误对象 同步宿主壳方案和共享决策记录
This commit is contained in:
@@ -9,8 +9,12 @@ const {
|
||||
|
||||
const WECHAT_SHARE_GRID_SAVE_UNAVAILABLE_MESSAGE = '九宫切图保存失败。';
|
||||
|
||||
function logShareGridFailure(label, _error) {
|
||||
console.error(`[share-grid] ${label}`);
|
||||
}
|
||||
|
||||
function rejectShareGridSaveFailure(reject, label, error) {
|
||||
console.error(`[share-grid] ${label}`, error);
|
||||
logShareGridFailure(label, error);
|
||||
reject(new Error(WECHAT_SHARE_GRID_SAVE_UNAVAILABLE_MESSAGE));
|
||||
}
|
||||
|
||||
@@ -199,7 +203,7 @@ function createWechatShareGridPage() {
|
||||
icon: 'success',
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('[share-grid] save failed', error);
|
||||
logShareGridFailure('save failed', error);
|
||||
this.setData({
|
||||
errorMessage: WECHAT_SHARE_GRID_SAVE_UNAVAILABLE_MESSAGE,
|
||||
loading: false,
|
||||
|
||||
@@ -65,10 +65,9 @@ describe('wechat share-grid shell page', () => {
|
||||
expect(page.data.loading).toBe(false);
|
||||
expect(page.data.errorMessage).toBe('九宫切图保存失败。');
|
||||
expect(page.data.errorMessage).not.toContain('private native download detail');
|
||||
expect(consoleError).toHaveBeenCalledWith(
|
||||
'[share-grid] download failed',
|
||||
{ errMsg: 'private native download detail' },
|
||||
);
|
||||
expect(consoleError).toHaveBeenCalledWith('[share-grid] download failed');
|
||||
expect(consoleError).toHaveBeenCalledWith('[share-grid] save failed');
|
||||
expect(consoleError.mock.calls.flat()).not.toContain('private native download detail');
|
||||
consoleError.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user