Better error reporting
(cherry picked from commit 9cbc5987e9ee20ca3dd66e690630a26e2f2a44eb)