跳转到内容

throwIfAborted

throwIfAborted 函数会在传入的中止信号已被中止的情况下抛出错误,包含中止的原因。该函数是为了在未实现 new AbortSignal().throwIfAborted() 的环境中提供支持。

导入

import { throwIfAborted } from "@tai-kun/surrealdb/utils";

使用方法

function throwIfAborted(signal: AbortSignal | null | undefined): void;

参数

signal
中止信号。

返回值

无。