Set an error in all failure cases. (#324332, Tim-Philipp Müller)