throwing exceptions with helpful error messages.