isAbortError
Problem
You need to distinguish an abort-caused rejection from other errors — for example silently ignoring cancellations while reporting real failures.
Solution
Use isAbortError(value) to check whether an error has name === 'AbortError'.
ts
import { isAbortError } from '@vielzeug/arsenal';
try {
await abortableTask;
} catch (err) {
if (isAbortError(err)) return; // cancelled — ignore
throw err; // real failure — re-throw
}Pitfalls
- Checks
error.name === 'AbortError', notinstanceof DOMException. Works forDOMExceptionand anyErrorsubclass with that name.