We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL : http://liubin.org/promises-book/#race-delay-timeout
在 我们定义了 TimeoutError 类和构造函数,这个类继承了Error的prototype。 它的使用方法和普通的 Error 对象一样,使用 throw 语句即可,如下所示。 下面的代码块,
我们定义了 TimeoutError 类和构造函数,这个类继承了Error的prototype。 它的使用方法和普通的 Error 对象一样,使用 throw 语句即可,如下所示。
var promise = new Promise(function(){ throw TimeoutError("timeout"); }); promise.catch(function(error){ console.log(error instanceof TimeoutError);// true });
应该是 throw new TimeoutError("timeout")
throw new TimeoutError("timeout")
The text was updated successfully, but these errors were encountered:
No branches or pull requests
URL : http://liubin.org/promises-book/#race-delay-timeout
在
我们定义了 TimeoutError 类和构造函数,这个类继承了Error的prototype。 它的使用方法和普通的 Error 对象一样,使用 throw 语句即可,如下所示。
下面的代码块,应该是
throw new TimeoutError("timeout")
The text was updated successfully, but these errors were encountered: