Attaches a callback function the rejection of the promise.
catch(callback?)
callback optional
The callback function to execute when the Promise is rejected.
A Promise for the completion of the callback.
let p = new Promise((resolve, reject) => {
reject(new Error("something happened"))
})
p.catch(error => print(error.message))
something happened