Good error messages explain what went wrong and how to fix it. Include the invalid value and expected format.
// Bad
throw new Error("Invalid input");
// Good
throw new Error(
`Expected email format, got: ${input}`
);
Messages should help developers debug without exposing sensitive data.