True when a request failed because the caller's own Signal aborted it — the replacement for
axios's isCancel.
A request's own HttpRequestConfig.Timeout elapsing is NOT a cancellation; that reports
HttpError.IsTimeout instead. The distinction matters because a cancellation is usually
an expected outcome to swallow, while a timeout is a fault worth logging or retrying.
A native AbortError — thrown when the signal was already aborted before the request
started — also counts.
Parameters
error: unknown
the value from a catch block.
Returns boolean
true when the failure was caller-initiated cancellation.
Example
catch (error) { if (IsCancellationError(error)) returnnull; // the caller gave up; stay quiet throwerror; }
True when a request failed because the caller's own
Signalaborted it — the replacement for axios'sisCancel.A request's own HttpRequestConfig.Timeout elapsing is NOT a cancellation; that reports HttpError.IsTimeout instead. The distinction matters because a cancellation is usually an expected outcome to swallow, while a timeout is a fault worth logging or retrying.
A native
AbortError— thrown when the signal was already aborted before the request started — also counts.