javascript - How do I work with the Bluebird error handler? -


INTRODUCTION

The purpose of this question is, finally, to solve a problem that I developed in Bluebird However, I am also using the opportunity to clarify some things, so there will be side-questions.

Question

As far as I understand, for the efforts of Bluebird, I also apologize in advance for the feelings of any emotion or have to face boredom Could. According to the following strategy, catch the ignorance of the ignorant wishes:

The second approach, which is bluebird by default, is to call a registered handler, if the other was rejected from the beginning Turn it up -

Now the first side-question is: What is the start of "second turn"?

If you attach to some promises, then hanging around the promise. After some time you will see annoying messages. In that situation you can indicate that any hanging exception should be thrown. -

Li>

function which will provide me the promise, in which I have a . Catch () :

  lib.loadUrls () .catch (function (e) {console.log}). (E);});  
  • Internally, that function loads content from URL1 and loads content in URL2 sequence, depending on the content:

      lib .loadUrls = Return this. Load URL 1. Then (this.loadUrl2.bind (this))  
  • If the second promise in this series is rejected error

  • < / Li>

    is unwanted and I can not understand why this is doing this so the question can be: Why an error handler is connected and executed, is BluBurder still considering the error of being "dismissed"?

    I'm thinking, obviously that the promise "is hanging around for a while" until the rejection promotes .catch () . In which case I should solve it (according to quoted documentation) using "by .done () ".

    Now, I have tried many things, but how do I use "D." in this scenario. (It does not help that the .done () returns the undefined, prevents me from in the end. -Eng.)

    So this is my third , And fourth question: How do I use .done () in this scenario, and how do I explicitly end the promise chain, but still one .finally ()

    1 Edit: I've created some JSFiddles to reproduce the bug:

    • Reproduce the bug.
    • Regenerates the bug (at this time)
    • Replaces No bug.

    Edit 2: Bug god

    This is actually a regression bug in just one bluebird and it is now fixed.

    .done () is a little too theoretical about the need to use, you will not run in any situation in practice, where you have to attach the error controller False positives can be reported in a way.


    Comments

    Popular posts from this blog

    ios - How do I use CFArrayRef in Swift? -

    eclipse plugin - Run java code error: Workspace is closed -

    c - Error on building source code in VC 6 -