Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error msg in notification #594

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api-engine/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Jinja2==2.11.3
jsonpointer==2.0
jsonschema==3.2.0
kubernetes==11.0.0
MarkupSafe==1.1.1
MarkupSafe==2.0.1
oauthlib==3.1.0
packaging==20.4
pathtools==0.1.2
Expand Down
10 changes: 8 additions & 2 deletions src/dashboard/src/utils/request.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { extend } from 'umi-request';
import { notification } from 'antd';
import { history } from 'umi';
Expand Down Expand Up @@ -25,8 +26,13 @@ const codeMessage = {
* 异常处理程序
*/
const errorHandler = error => {
const { response = {} } = error;
const errortext = codeMessage[response.status] || response.statusText;
const { response, data } = error;
const errortext = (
<>
{codeMessage[response.status] || response.statusText} <br />
{data && data.msg && Array.isArray(data.msg) && data.msg.length > 0 && data.msg[0]}
</>
);
const { status, url } = response;
let verifyUserFail = false;

Expand Down
Loading