improve cast error message
Merge pull request #4006 from WalterBright/improve-msg

improve cast error message