In my Angular.js application, I\'m running some asynchronous operation. Before it starts I cover the application with a modal div, then once the operation is complete, I nee
For those not using angularJS, and if you're ok with catching the error (not sure if .finally() would do that), you could use .catch().then() to avoid the duplicated code.
Promise.resolve()
.catch(() => {})
.then(() => console.log('finally'));
The catch() might end up being useful anyway for logging or other cleanup. https://jsfiddle.net/pointzerotwo/k4rb41a7/