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

建议错误提示更加明确 #83

Open
nikogu opened this issue May 30, 2016 · 1 comment
Open

建议错误提示更加明确 #83

nikogu opened this issue May 30, 2016 · 1 comment

Comments

@nikogu
Copy link

nikogu commented May 30, 2016

比如:https://github.com/dora-js/dora-plugin-proxy/blob/master/src/getProxyConfig.js#L37

这个地方,直接catch了,导致错误提示不完善,造成的问题就是:

proxy.config.js 里面必须使用'use strict' 才能使用 require的部分库,因为:

Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

建议将这段改成:

      try {
        cache = require(proxyFile);
      } catch (e) {
        log.error(`${configPath} parse error : ${e}`);
      }
@sorrycc
Copy link
Member

sorrycc commented May 30, 2016

提个 pr 吧。

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

No branches or pull requests

2 participants