rosshinkley / nightmare-examples

Examples and supplementary documentation for Nightmare
251 stars 46 forks source link

Promise examples should all have a `catch()` call #5

Closed Mr0grog closed 8 years ago

Mr0grog commented 8 years ago

Insofar as these should all demonstrate good conventions, the promise examples should all end with a catch call to surface any errors (the Vo and Co examples using generators are fine because those libraries will bubble up the errors for you if you don’t have a try... catch block).

.catch(function(error) {
  console.error('An error occurred:', error);
});
rosshinkley commented 8 years ago

Agreed. :) I should have been a little more careful in putting the original examples together.