ant-design / ant-design/pro-components
🧐[问题] BaseForm 中为什么要吞掉 onFinish 方法的异常?
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
### 🧐 问题描述
https://github.com/ant-design/pro-components/blob/32cb3b8f85d38e5ee60e73440207617340890def/packages/form/src/BaseForm/BaseForm.tsx#L708-L711
吞掉了onFinish中的异常,导致我在ErrorBoundary中无法捕获这个异常发送到 Sentry。
请问有方法可以解决这个问题吗?如果要在每个 调用里面去写这段逻辑会显得很啰嗦。
### 💻 示例代码
```ts
throw Error("error")}>
```
### 🚑 其他信息
Contributor guide
Research direction
Start by reading packages/form/src/BaseForm/BaseForm.tsx at lines 708-711 and compare it with the provided ProForm example. Trace how the onFinish exception is handled, then verify that the resulting behavior allows ErrorBoundary and Sentry to observe it without adding logic to every ProForm call.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100