Issue #24872:improve error messages
Merge pull request #543 from garyhgohoos/24872

Issue #24872:improve error messages