feat: add detailed error message for category loading failure
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
});
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user