abortSignal.reason


当触发 AbortSignal 时指定的可选的原因。

const ac = new AbortController();
ac.abort(new Error('boom!'));
console.log(ac.signal.reason);  // Error('boom!');

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!');