javascript promise chain error handling code example Example: handle error in promise chain promise.then(successHandler).catch(errorHandler);