feat: add detailed error message for category loading failure

This commit is contained in:
小鱼开发
2026-05-18 21:51:06 +08:00
parent 5cfdd5cf19
commit 61a2cf5f0d
@@ -46,9 +46,10 @@ export default function ScriptCreation() {
.then(data => {
setCategories(data);
})
.catch(() => {
.catch((err: Error) => {
console.error('[分类加载失败]', err);
if (!cached) {
toast.error('加载分类列表失败');
toast.error(`加载分类列表失败: ${err.message}`);
}
});
}, []);