目录
当前位置: 首页 > 文档资料 > Lazy.js 英文文档 >

onError

优质
小牛编辑
135浏览
2023-12-01

Updates the handle with a callback to execute if/when any error is encountered during asynchronous iteration.

Signature

AsyncHandle.onError = function(callback) { /*...*/ }
AsyncHandle.onError = function onError(callback) {
  this.rejectListeners.push(callback);
  return this;
}
NameType(s)Description
callbackFunction

The function to call, with any associated error object, when an error occurs.