How do you write error messages that help the people using your library?
I maintain a small internal library and keep getting the same questions because the errors just say things like "invalid config".
My new rule is that every error should say what was wrong, what value was received, and what the caller can do about it. That turns "invalid config" into something like "timeout must be a positive number, got -5".
What else makes an error message good in your experience?
Comments · 0
No replies yet — start the conversation.