throw explicit error instead of IllegalArgumentException