Don't use negative numbers for error codes
A warning to programmers - try to understand how people will use your error codes.
This morning, I was confronted with a rather bemusing error message on my WordPress blog:
Ok, so this should "never happen" and yet somehow it has. I wonder what on earth the error code means? I selected the error code and Googled it!

I just copied and pasted the error message into Google and got back a set of meaningless results. Why?
Most search engines treat the minus sign as an "excludes" operator. Suppose I want to search for information about the Python programming language, but I don't want any results about snakes; Google lets me search for "python -snake".
In this case, Google is searching for every error code except for the one I want!
If we remove the -
sign, the correct results are returned.

I've raised this as an issue with the software.
Remember, your error messages should be meaningful to the user. It should contain a clear explanation of what has happened and how the problem can be fixed. It should also be easy to search for information about the error. This message, sadly, fails at all three of those reasonable objectives.
Alex B says:
Terence Eden says:
Terence Eden says:
Terence Eden says:
Alex B says:
Or maybe even put the error in the message in the first place?Heck, you can even include a hypertext link to the docs about that error.I mean you're a web page, not an embedded dos program, act like it.