Skip to content

函数: isDrawError()

ts
function isDrawError(error): error is DrawError;

定义于: packages/draw/src/error.ts:26

类型守卫:是否为 DrawError

参数

参数类型
errorunknown

返回

error is DrawError

示例

ts
try {
  await draw.poster(profile, bests);
} catch (error) {
  if (isDrawError(error)) console.error(error.message);
}