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

feat(web): 优化适配器异常时的页面错误信息展示 #1182

Merged
merged 9 commits into from
Apr 11, 2024

Conversation

piccaSun
Copy link
Contributor

@piccaSun piccaSun commented Mar 29, 2024

背景

适配器或调度器出现异常导致适配器接口请求无法正常发起的情况,大部分页面仍然报错 500 undefined

做了什么

此PR主要修改了适配器异常请求无法连接的时候的页面错误处理
在门户系统增加全局错误处理,优化管理系统全局错误处理

门户系统适配器异常时示例
image
image

image

对于页面已单独处理过的500请求报错信息保持原有样式

管理系统适配器异常时示例
多集群同步操作:
image
image

单集群操作:
image
image

此PR针对适配器异常情况,优化处理各接口页面报错信息,具体接口及特殊情况备注如下
image

Copy link

changeset-bot bot commented Mar 29, 2024

🦋 Changeset detected

Latest commit: 6eeaaf1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@scow/portal-web Patch
@scow/mis-web Patch
@scow/auth Patch
@scow/gateway Patch
@scow/mis-server Patch
@scow/portal-server Patch
@scow/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@piccaSun piccaSun changed the title feat(web): 优化适配器无法启动时的页面错误信息展示 feat(web): 优化适配器异常时的页面错误信息展示 Apr 3, 2024
@piccaSun piccaSun marked this pull request as ready for review April 3, 2024 05:56
@pkuhpc-review-bot pkuhpc-review-bot bot added the Code-ReviewRequested Code Review Requested label Apr 3, 2024
@pkuhpc-review-bot pkuhpc-review-bot bot requested a review from ddadaal April 3, 2024 05:56
apps/portal-web/src/pages/api/app/getAppSessions.ts Outdated Show resolved Hide resolved
apps/portal-web/src/pages/api/app/getAppSessions.ts Outdated Show resolved Hide resolved
apps/mis-server/src/plugins/clusters.ts Show resolved Hide resolved
apps/mis-web/src/utils/route.ts Outdated Show resolved Hide resolved
apps/portal-web/src/utils/getClusterConnError.tsx Outdated Show resolved Hide resolved
@pkuhpc-review-bot pkuhpc-review-bot bot added Code-ChangeRequested and removed Code-ReviewRequested Code Review Requested labels Apr 3, 2024
@piccaSun piccaSun requested a review from ddadaal April 7, 2024 12:05
@pkuhpc-review-bot pkuhpc-review-bot bot added Code-ReviewRequested Code Review Requested and removed Code-ChangeRequested labels Apr 7, 2024

export const ADAPTER_CALL_ON_ONE_ERROR = "ADAPTER_CALL_ON_ONE_ERROR";

export const callOnOne: CallOnOne = async (cluster, logger, call) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数很好

@pkuhpc-review-bot pkuhpc-review-bot bot added Code-Approved Code Review approved ReadyForMerge Ready for merge and removed Code-ReviewRequested Code Review Requested labels Apr 8, 2024
@pkuhpc-review-bot pkuhpc-review-bot bot added E2E-ReviewRequested E2E Test requested and removed ReadyForMerge Ready for merge labels Apr 8, 2024
@pkuhpc-review-bot pkuhpc-review-bot bot added E2E-Approved E2E Test approved ReadyForMerge Ready for merge and removed E2E-ReviewRequested E2E Test requested labels Apr 11, 2024
@ddadaal ddadaal merged commit 5c34421 into master Apr 11, 2024
8 checks passed
@ddadaal ddadaal deleted the feat-adapter-down-error-message branch April 11, 2024 12:47
ddadaal pushed a commit that referenced this pull request May 29, 2024
**问题背景**

在适配器异常时页面统一错误处理的issue中  #1182 

如果已经是处理封装过的`grpc error`, 会在 `callOnOne`执行时统一处理为 `code =
status.INTERNAL`的错误且将errorObject直接写入details,导致部分页面出现
适配器的错误信息详细变为嵌套型对象,无法正确解析

![image](https://github.com/PKUHPC/SCOW/assets/43978285/054e0f47-8d6e-4350-81dc-676e78ac6fcf)


**修改**
统一错误处理时 判断callOnOne返回的error类型,如果是已处理过的grpc error直接抛出错误

**修改后**
前端页面可以正确获取已处理的grpc error的 code, message等,正确显示前端对应的错误信息
统一错误处理也可正常显示


![image](https://github.com/PKUHPC/SCOW/assets/43978285/0d1a0e89-4d73-4899-bfce-c583793ec3e4)

![image](https://github.com/PKUHPC/SCOW/assets/43978285/bf1591fe-1862-4f5a-bb32-26528cd7f6cb)


![image](https://github.com/PKUHPC/SCOW/assets/43978285/a209ad99-d871-42be-9ab7-c0c1ff3716a5)
OYX-1 pushed a commit that referenced this pull request Jul 4, 2024
**问题背景**

在适配器异常时页面统一错误处理的issue中  #1182 

如果已经是处理封装过的`grpc error`, 会在 `callOnOne`执行时统一处理为 `code =
status.INTERNAL`的错误且将errorObject直接写入details,导致部分页面出现
适配器的错误信息详细变为嵌套型对象,无法正确解析

![image](https://github.com/PKUHPC/SCOW/assets/43978285/054e0f47-8d6e-4350-81dc-676e78ac6fcf)


**修改**
统一错误处理时 判断callOnOne返回的error类型,如果是已处理过的grpc error直接抛出错误

**修改后**
前端页面可以正确获取已处理的grpc error的 code, message等,正确显示前端对应的错误信息
统一错误处理也可正常显示


![image](https://github.com/PKUHPC/SCOW/assets/43978285/0d1a0e89-4d73-4899-bfce-c583793ec3e4)

![image](https://github.com/PKUHPC/SCOW/assets/43978285/bf1591fe-1862-4f5a-bb32-26528cd7f6cb)


![image](https://github.com/PKUHPC/SCOW/assets/43978285/a209ad99-d871-42be-9ab7-c0c1ff3716a5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code-Approved Code Review approved E2E-Approved E2E Test approved ReadyForMerge Ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants