promise chain with different error messages code example Example: handle error in promise chain promise.then(successHandler).catch(errorHandler);