catch()
returns a Promise and deals with rejected cases only
prerequisites for understanding
- return a fulfilled promise, to pass a test
- reminder: the test passes when a fulfilled promise is returned
catch
method basics
- is an instance method
- catches only promise rejections
- returns a new promise
- converts it`s return value into a promise
- the first parameter is the rejection reason
multiple catch
es
- only the first
catch
is called - if a
catch
throws, the nextcatch
catches it
Links
A short description of how `catch` works.
The actual chapter about `catch`, you need to dive in from here.
The description of the actual flow of `catch`.