feat: add detailed error message for category loading failure

This commit is contained in:
小鱼开发
2026-05-18 21:51:06 +08:00
parent 26d0901fd2
commit 721d690370
@@ -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}`);
}
});
}, []);