{"action":"opened","issue":{"url":"https://api.github.com/repos/liubin/promises-book/issues/41","repository_url":"https://api.github.com/repos/liubin/promises-book","labels_url":"https://api.github.com/repos/liubin/promises-book/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/liubin/promises-book/issues/41/comments","events_url":"https://api.github.com/repos/liubin/promises-book/issues/41/events","html_url":"https://github.com/liubin/promises-book/issues/41","id":233374941,"number":41,"title":"TimeoutError 需要使用 new 来创造","user":{"login":"MoonBall","id":13298548,"avatar_url":"https://avatars2.githubusercontent.com/u/13298548?v=3","gravatar_id":"","url":"https://api.github.com/users/MoonBall","html_url":"https://github.com/MoonBall","followers_url":"https://api.github.com/users/MoonBall/followers","following_url":"https://api.github.com/users/MoonBall/following{/other_user}","gists_url":"https://api.github.com/users/MoonBall/gists{/gist_id}","starred_url":"https://api.github.com/users/MoonBall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MoonBall/subscriptions","organizations_url":"https://api.github.com/users/MoonBall/orgs","repos_url":"https://api.github.com/users/MoonBall/repos","events_url":"https://api.github.com/users/MoonBall/events{/privacy}","received_events_url":"https://api.github.com/users/MoonBall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-06-03T15:05:49Z","updated_at":"2017-06-03T15:05:49Z","closed_at":null,"body":"URL : http://liubin.org/promises-book/#race-delay-timeout\r\n\r\n在 `\r\n我们定义了 TimeoutError 类和构造函数，这个类继承了Error的prototype。\r\n它的使用方法和普通的 Error 对象一样，使用 throw 语句即可，如下所示。\r\n` 下面的代码块，\r\n\r\n`\r\nvar promise = new Promise(function(){\r\n    throw TimeoutError(\"timeout\");\r\n});\r\n\r\npromise.catch(function(error){\r\n    console.log(error instanceof TimeoutError);// true\r\n});\r\n`\r\n\r\n应该是 `throw new TimeoutError(\"timeout\")`"}}
{"actor":{"display_login":"MoonBall"}}