fix(mp): 空 catch 块添加 console.warn 日志(82 处)
55 个文件中 82 处空 catch 块添加模块前缀日志输出: - stores: auth/health/points (7 处) - services: request/ai-chat/health/ble/* (10 处) - hooks: useLongPolling/usePagination (3 处) - pages: 核心+子包共 35 个页面 (62 处) 保留静默的 catch: secure-storage fallback、Storage 恢复、 analytics 防洪、BLE 断连清理、用户拒绝订阅等合理忽略场景
This commit is contained in:
@@ -28,7 +28,8 @@ export default function MedicationReminder() {
|
||||
try {
|
||||
const res = await listReminders();
|
||||
setReminders(res.data ?? []);
|
||||
} catch {
|
||||
} catch (err) {
|
||||
console.warn('[medication] 加载失败:', err);
|
||||
Taro.showToast({ title: '加载失败', icon: 'none' });
|
||||
} finally {
|
||||
setLoading(false);
|
||||
@@ -44,7 +45,8 @@ export default function MedicationReminder() {
|
||||
version: r.version,
|
||||
});
|
||||
fetchReminders();
|
||||
} catch {
|
||||
} catch (err) {
|
||||
console.warn('[medication] 操作失败:', err);
|
||||
Taro.showToast({ title: '操作失败', icon: 'none' });
|
||||
}
|
||||
};
|
||||
@@ -59,7 +61,8 @@ export default function MedicationReminder() {
|
||||
await deleteReminder(r.id, r.version);
|
||||
Taro.showToast({ title: '已删除', icon: 'success' });
|
||||
fetchReminders();
|
||||
} catch {
|
||||
} catch (err) {
|
||||
console.warn('[medication] 删除失败:', err);
|
||||
Taro.showToast({ title: '删除失败', icon: 'none' });
|
||||
}
|
||||
}
|
||||
@@ -90,7 +93,8 @@ export default function MedicationReminder() {
|
||||
setShowForm(false);
|
||||
Taro.showToast({ title: '添加成功', icon: 'success' });
|
||||
fetchReminders();
|
||||
} catch {
|
||||
} catch (err) {
|
||||
console.warn('[medication] 添加失败:', err);
|
||||
Taro.showToast({ title: '添加失败', icon: 'none' });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user