Skip to content

Instantly share code, notes, and snippets.

@Artur-Sulej
Created August 4, 2015 10:54
Show Gist options
  • Save Artur-Sulej/63bcc74053afc0ce6479 to your computer and use it in GitHub Desktop.
Save Artur-Sulej/63bcc74053afc0ce6479 to your computer and use it in GitHub Desktop.
Convenient function for creating http errors in JavaScript.
function HTTP_Error(msg, status) {
var error = new Error(msg);
error.status = status;
return error;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment