abortSignal.reason
- 类型: <any>
当触发 AbortSignal
时指定的可选的原因。
const ac = new AbortController();
ac.abort(new Error('boom!'));
console.log(ac.signal.reason); // Error('boom!');
- Type: <any>
An optional reason specified when the AbortSignal
was triggered.
const ac = new AbortController();
ac.abort(new Error('boom!'));
console.log(ac.signal.reason); // Error('boom!');