Skip to content

函数: isProberError()

ts
function isProberError(error): error is ProberError;

定义于: packages/prober/src/error.ts:55

类型守卫:是否为 ProberError(含各适配子类)。

参数

参数类型描述
errorunknown任意捕获值

返回

error is ProberError

是否为查分器错误

示例

ts
try {
  await player.getBests();
} catch (error) {
  if (isProberError(error)) console.error(error.status, error.message);
}