msg
returns a promise, msg2
(the outer one) doesn't.
(msg
返回一个承诺, msg2
(外部)不返回。)
That means it's possible for code calling msg
to know when the asynchronous operation completes, but it's not possible for code calling msg2
.(这意味着调用msg
代码有可能知道异步操作何时完成,但是调用msg2
代码则msg2
。)
( msg2
also fails to handle rejection or pass the chain to the caller so the caller can handle rejection, which breaks one of the fundamental rules of promises: always either handle rejection or return the chain.)
(( msg2
也无法处理拒绝或将链传递给调用方,因此调用方可以处理拒绝,这违反了promise的基本规则之一:始终处理拒绝或返回链。))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…