feat: catch errors when sending messages #918 (#1113)

### What problem does this PR solve?

feat: catch errors when sending messages #918

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-11 15:46:12 +08:00
committed by GitHub
parent e28d13e3b4
commit 8902d92d0e
10 changed files with 51 additions and 44 deletions

View File

@ -1,4 +1,5 @@
import { Authorization } from '@/constants/authorization';
import { ResponseType } from '@/interfaces/database/base';
import i18n from '@/locales/config';
import authorizationUtil, { getAuthorization } from '@/utils/authorizationUtil';
import { message, notification } from 'antd';
@ -42,12 +43,6 @@ type ResultCode =
| 503
| 504;
interface ResponseType {
retcode: number;
data: any;
retmsg: string;
status: number;
}
const errorHandler = (error: {
response: Response;
message: string;