handling error
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, {useContext, useEffect} from "react";
|
||||
import {Button, Card, Col, Input, Row, Upload} from "antd";
|
||||
import {Button, Card, Col, Input, Row, Upload,message} from "antd";
|
||||
import {FilterOutlined, PlusSquareOutlined, UploadOutlined,} from "@ant-design/icons";
|
||||
import {BreadcumbComponent} from "../../component/BreadcumbComponent";
|
||||
import {useStore} from "../../utils/useStore";
|
||||
@@ -27,6 +27,11 @@ export const Product = observer(() => {
|
||||
modalLoader.setLoading(false);
|
||||
} catch (e) {
|
||||
modalLoader.setLoading(false);
|
||||
if (e.response?.body?.message) {
|
||||
message.error(e.response.body.message);
|
||||
return;
|
||||
}
|
||||
message.error(e.message);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user