Copy error handling from Array#reduceRight() to Array#reduce().