.NET Tips and Tricks

Blog archive

Writing Great Error Messages

I knew this, I really did, but I had to be reminded: A really good error message doesn't tell the user that something's wrong or even what it is that's wrong. A really good error message tells the user what they need to do to solve this problem.

You don't want to have your error messages say things like "Invoices cannot be processed" or even "Invoices cannot be processed: Invoices have different due dates." Those error messages just tell the user what's gone wrong (in varying levels of detail). Instead, tell the user what to do and then, if you want, what the problem is: "Only select invoices with the same due dates -- the selected invoices have multiple due dates."

And, by the way: Always write the error message from the user's point of view and using the user's vocabulary. I remember getting one error message that ended with "…and if this is a server-side error, contact System Administration." How the users, from their point of view, were going to figure out that the problem was (or wasn't) a 'server-side error' was a mystery to me.

Posted by Peter Vogel on 09/19/2013


comments powered by Disqus

Featured

  • Microsoft Eases Integration with Semantic Kernel AI SDK

    The basic idea is to provide unified API abstractions, especially for idiomatic C# code, to help platform developers and others work with any provider with standard implementations for caching, telemetry, tool calling and other common tasks.

  • Final .NET 9 Preview Ships with Go-Live License

    Visual Studio developers can now download the SDK for .NET 9 Release Candidate 2 with a go-live license, meaning devs get Microsoft support for production applications even before the framework reaches general availability next month.

  • Upcycle Your Old Laptops into a Kubernetes Cluster

    Learn about Windows-to-Linux conversions and how to break and fix cloud containers -- all while helping to save the world from e-waste with some "sheer geeky fun."

  • Visual Studio's Future: Live Help to 'AI-ify Your App'

    Visual Studio guru Mads Kristensen provided a peek into the IDE's AI future, explaining how while in live-coding it will identify opportunities for your own app to use AI to your advantage.

Subscribe on YouTube