Throw error when a resolve promise fails.