summaryrefslogtreecommitdiffstats
path: root/src/hci/strerror.c
diff options
context:
space:
mode:
authorMichael Brown2010-10-19 07:14:22 +0200
committerMichael Brown2010-10-19 07:14:22 +0200
commit4995ffa438d3bc9cd85a7622d0e2433efeb5b03f (patch)
tree2c0180ef4f7b3945396526f38a783c6a13d03040 /src/hci/strerror.c
parent[contrib] Remove extraneous errcodedb files (diff)
downloadipxe-4995ffa438d3bc9cd85a7622d0e2433efeb5b03f.tar.gz
ipxe-4995ffa438d3bc9cd85a7622d0e2433efeb5b03f.tar.xz
ipxe-4995ffa438d3bc9cd85a7622d0e2433efeb5b03f.zip
[hci] Use http://ipxe.org/<errno> instead of raw error numbers
Users tend to gloss over cryptic-looking error messages such as "Boot failed: Exec format error (Error 0x2e852001)" In particular, users tend not to report the error number, which is the single most useful piece of diagnostic information in an iPXE error message. Try replacing the "Error 0x2e852001" portion with a URL, giving "Boot failed: Exec format error (http://ipxe.org/2e852001)" in the hope that users will, upon seeing something that is recognisably a URL, try viewing it in a web browser. Such users will be greeted by a web page containing a more detailed description of the error (automatically generated from the einfo text), including links to each line of code that might generate the error, and a section for additional user-contributed notes. At the time of writing, a user who visits http://ipxe.org/2e852001 would see a note saying "This error usually indicates that the SAN disk is empty, and does not yet contain a bootable operating system." which may be more useful than "Exec format error (Error 0x2e852001)". Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/strerror.c')
-rw-r--r--src/hci/strerror.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/hci/strerror.c b/src/hci/strerror.c
index 3caee497..9356e9e0 100644
--- a/src/hci/strerror.c
+++ b/src/hci/strerror.c
@@ -87,10 +87,13 @@ const char * strerror ( int errno ) {
/* Construct the error message */
if ( errortab ) {
- snprintf ( errbuf, sizeof ( errbuf ), "%s (%#08x)",
+ snprintf ( errbuf, sizeof ( errbuf ),
+ "%s (http://ipxe.org/%08x)",
errortab->text, errno );
} else {
- snprintf ( errbuf, sizeof ( errbuf ), "Error %#08x", errno );
+ snprintf ( errbuf, sizeof ( errbuf ),
+ "Error %#08x (http://ipxe.org/%08x)",
+ errno, errno );
}
return errbuf;