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: allow customize isProd function #30

Closed
wants to merge 2 commits into from

Conversation

Jeff-Tian
Copy link

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

在碰到错误时,有一个判断是否为生产环境的逻辑 isProd,目前不能被自定义。故添加了自定义这个逻辑的功能,望采纳!

默认逻辑是看 app.config.env,如果不是 local 或者 unittest,就认为是正式生产环境,然而多数现实情况下,除了 local 和 unittest ,还有多个环境,比如:

  • dev
  • test
  • stage
  • prod
  • canary
  • qa
    等等。很可能我们希望 dev 和 test 不算作正式环境(可以暴露原始错误堆栈信息)。

通过允许在 onerror 配置中自定义这个逻辑,可以让以上需求实现起来比较简单。

@codecov
Copy link

codecov bot commented Aug 13, 2019

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@popomore
Copy link
Member

我们认为非本地环境都是在服务器部署的,行为应该一致,这个不应该被修改。

@Jeff-Tian
Copy link
Author

Jeff-Tian commented Aug 26, 2019 via email

@hyj1991
Copy link
Member

hyj1991 commented Dec 10, 2021

Duplicated with #33.

@fengmk2 fengmk2 closed this Oct 13, 2024
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.

4 participants