added explicit error msgs when throwing exceptions