more helpful error message and missed global
more helpful error message and missed global


Former-commit-id: c5002c4249435b6ccdbe9cd743c556adbc178a7a [formerly 49e327925fff523536fab6390567ce700120be64]
Former-commit-id: b97313e8e4c1379f1c4c522d016f2478b2dd6d4e
romancow/Sugar,andrewplummer/Sugar,romancow/Sugar,andrewplummer/Sugar