promises not catching syntax errors code example Example: handle error in promise chain promise.then(successHandler).catch(errorHandler);