Skip to content

Instantly share code, notes, and snippets.

@jpallen
jpallen / errorhandling.js
Created October 10, 2012 13:26
errorhandling
function respondWithError(response, namespace, message, status) {
if (!status) {
status = 500;
}
console.log(namespace, message);
response.setHeader('Content-Type','application/json');
response.writeHead(status);
response.end(JSON.stringify("Missing guid"));
}