finally
это аналог then( () => {}, () => {} )
finally
не обрабатывает ее, а промис виснит?fetch().finally( () => 'error')
If the handler throws an error or returns a rejected promise, the promise returned by finally() will be rejected with that value instead. Otherwise, the return value of the handler does not affect the state of the original promise.
...
UnlikePromise.resolve(2).then(() => 77, () => {})
(which will return a resolved promise with the result 77),Promise.resolve(2).finally(() => 77)
will return a new resolved promise with the result 2.
Similarly, unlikePromise.reject(3).then(() => {}, () => 88)
(which will return a resolved promise with the value 88),Promise.reject(3).finally(() => 88)
will return a rejected promise with the reason 3.
But, bothPromise.reject(3).finally(() => {throw 99})
andwill reject the returned promise with the reason 99.Promise.reject(3).finally(() => Promise.reject(99))