Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2011
What would you like to do?
HTTP Error Responses by MIME Type
This is a collection of templates, that depict HTTP error messages in different MIME types.
Each template expects the parameters
* {CODE} - the numeric HTTP error code
* {PHRASE} - the reason phrase, e.g., "Not Found" for 404
and in some cases the parameter
* {URL} - the requested URL where the error occurred. This value MUST be quoted adeptly for each template.
/* {CODE} {PHRASE} */
body {}
if (this.console && this.console.error) {
console.error('{CODE} {PHRASE}\nLocation: {URL}');
"error": true,
"errno": {CODE},
"errmsg": "{PHRASE}",
"errlocation": "{URL}"
<?xml version="1.0" encoding="UTF-8" ?>
<math xmlns="">
<merror>{CODE} {PHRASE}</merror>
<?xml version="1.0" encoding="UTF-8" ?>
<RDF xmlns=""
<http:Response rdf:ID="response">
<http:sc rdf:resource="{CODE}" />
<http:headers rdf:parseType="Collection">
<http:hdrName rdf:resource=""/>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<?xml version="1.0" encoding="UTF-8" ?>
<stylesheet version="1.0" xmlns="">
<template match="/">
<message terminate="yes">{CODE} {PHRASE}</message>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment