<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>errors &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/errors/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Fri, 15 Jul 2016 07:28:00 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>errors &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Don't use negative numbers for error codes]]></title>
		<link>https://shkspr.mobi/blog/2016/07/dont-use-negative-numbers-for-error-codes/</link>
					<comments>https://shkspr.mobi/blog/2016/07/dont-use-negative-numbers-for-error-codes/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 15 Jul 2016 07:28:00 +0000</pubDate>
				<category><![CDATA[usability]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=23056</guid>

					<description><![CDATA[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 &#34;never happen&#34; 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 …]]></description>
										<content:encoded><![CDATA[<p>A warning to programmers - try to understand how people will use your error codes.</p>

<p>This morning, I was confronted with a rather bemusing error message on my WordPress blog:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/07/An-error-code-with-a-negative-number-fs8.png" alt="An error code with a negative number" width="1053" height="297" class="aligncenter size-full wp-image-23059"></p>

<p>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 <a href="https://www.google.co.uk/search?q=Error+code%3A+-32300">Googled it</a>!</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/07/Google-results-for-searching-for-an-error-code-fs8.png" alt="Google results for searching for an error code" width="766" height="676" class="aligncenter size-full wp-image-23058">

<p>I just copied and pasted the error message into Google and got back a set of meaningless results.  Why?</p>

<p>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 "<a href="https://www.google.co.uk/search?q=python%20-snake">python -snake</a>".</p>

<p>In this case, Google is searching for every error code <strong>except for the one I want!</strong></p>

<p>If we remove the <code>-</code> sign, <a href="https://www.google.co.uk/search?q=Error+code%3A+32300">the correct results are returned</a>.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/07/Google-search-for-error-code-without-a-negative-number-correct-results-returned-fs8.png" alt="Google search for error code without a negative number - correct results returned" width="782" height="675" class="aligncenter size-full wp-image-23057">

<p>I've <a href="https://github.com/Automattic/jetpack/issues/4410">raised this as an issue with the software</a>.</p>

<p>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.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=23056&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2016/07/dont-use-negative-numbers-for-error-codes/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
	</channel>
</rss>
