throw CasterException and improved error message instead of NPE