Handle promise rejection.