Skip to content

Instantly share code, notes, and snippets.

@elrrrrrrr
Created August 18, 2014 08:59
Show Gist options
  • Save elrrrrrrr/e840e8a46acb7af055d7 to your computer and use it in GitHub Desktop.
Save elrrrrrrr/e840e8a46acb7af055d7 to your computer and use it in GitHub Desktop.
自定义错误类型
function MyError(code, message) {
this.code = code;
this.message = message;
}
MyError.prototype = new Error();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment