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

Repair: 在资源路径不存在下error为undefined的情况 #27

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

zengzjie
Copy link
Contributor

ff469fcf-7a8c-442b-ab27-aae4a83b6b74
image

在本地接入的项目中引入一个不存在的资源路径地址后抛出错误,此错误应在内部消化掉而不抛出给客户端

2f7e6f04-ca55-484d-97d3-065af5312182

修复后的测试用例结果

Comment on lines 43 to 44
const defaultMessage = 'An unknown error occurred';
const defaultStack = 'No stack trace available';
Copy link
Member

Choose a reason for hiding this comment

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

这两个信息放一起吧,加个前缀: [PageSpy] An unknown error ...

Comment on lines 46 to 48
name: '',
message: defaultMessage,
stack: defaultStack,
Copy link
Member

Choose a reason for hiding this comment

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

ErrorPlugin.sendMessage 的第二个参数 errorDetail 在调试端被用于查看错误信息堆栈、定位源码,字段值期望是标准的 error 信息,这里不适合默认值,可以用 null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

感谢回复,已做相应调整了

@wqcstrong wqcstrong merged commit 6919682 into HuolalaTech:main Dec 20, 2023
@wqcstrong
Copy link
Member

感谢你的帮助 👍

@zengzjie zengzjie deleted the repair/plugins-error branch December 20, 2023 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants