more informative error
(cherry picked from commit fda383d018305cdd5f399aaa8a672e0264445522)