收藏
回答

小程序ci工具内部异步异常,无法被外部try/catch捕获导致程序一直pending无法走到下一步

框架类型 问题类型 操作系统 工具版本
小程序 Bug Windows miniprogram-ci 2.0.10

https://developers.weixin.qq.com/miniprogram/dev/devtools/ci.html

调用miniprogram-ci 2.0.10的预览功能,当出现privateKey格式不正确,项目路径不对等异常时,无法在外面包裹的try/catch中捕获到promise的异常,然后就一直pending住,没法正常返回

能够在控制台输出此类异常信息,但是外部捕获不到

回答关注问题邀请回答
收藏

1 个回答

  • 社区技术运营专员--Demons
    社区技术运营专员--Demons
    02-18

    工具版本是多少

    02-18
    有用
    回复 2
    • 出云银河
      出云银河
      02-18
      2.0.10
      02-18
      回复
    • 出云银河
      出云银河
      04-23
      有办法解决这个问题吗?代码跟示例写的一模一样,当我传入一个不正确的私钥的时候,就会无限pending,不会被trycatch捕获,但是如果我注册一个process.on(unhandledRejection, listener);里面是能够触发并且拿到错误的,但是这个逻辑就不对了,我没法正常的去让原来的proimise往下继续走rejcet流程,[error] 20002 generate local signature fail. Usually this happens the content or encoding of private key file is incorrect. Detail: Error: error:0909006C:PEM routines:get_name:no start line
      log.js:1
      [error] get wx0d14f77fca85fadd project attr fail Error: generate local signature fail. Usually this happens the content or encoding of private key file is incorrect. Detail: Error: error:0909006C:PEM routines:get_name:no start line
      04-23
      回复
登录 后发表内容