Tip: Include Context And Propose Solutions In Your Error Messages
source link: https://blog.jakubholy.net/2013/05/23/tip-include-context-and-propose-solutions-in-your-error-messages/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Tip: Include Context And Propose Solutions In Your Error Messages
If you know puppet well enough, you will immediatelly know what is wrong and how to fix it. But what if you don't know what a 'selector' is? Interpreting error messages is often hard without deep knowledge of the software. Be nice to the users / fellow programmers, do not expect they know everything, and include helpful context and preferably also suggest some possible solutions. If the message read instead:"No matching selector for 'prod' at some_puppet_file.pp:31"
wouldn't it be much more clear and helpful?"No matching selector for 'prod' at some_puppet_file.pp:31; the available selectors are 'production', 'test', 'staging'; have you forgotten to add 'prod' or default?"
Are you benefitting from my writing? Consider buying me a coffee or supporting my work via GitHub Sponsors. Thank you! You can also book me for a mentoring / pair-programming session via Codementor or (cheaper) email.
Allow me to write to you!
Let's get in touch! I will occasionally send you a short email with a few links to interesting stuff I found and with summaries of my new blog posts. Max 1-2 emails per month. I read and answer to all replies.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK