类: MaimaiDatabaseNotImplementedError
定义于: packages/database/src/error.ts:102
当前数据源无法实现 MaimaiDatabase 某一方法时抛出的包级错误。
供各适配在「接口必须实现、上游无对等能力」时使用;调用方可用 isMaimaiDatabaseNotImplementedError 做能力降级(与 HTTP/业务失败区分)。
示例
适配内
ts
throw new MaimaiDatabaseNotImplementedError({
method: "getAliasList",
adapter: "Diving-Fish",
});调用方
ts
try {
aliases = await db.getAliasList();
} catch (error) {
if (isMaimaiDatabaseNotImplementedError(error)) {
// 换数据源或跳过
}
}参阅
继承
属性
| 属性 | 修饰符 | 类型 | 描述 | 定义于 |
|---|---|---|---|---|
adapter? | readonly | string | 适配显示名(若构造时传入) | packages/database/src/error.ts:106 |
method | readonly | string | 未实现的方法名 | packages/database/src/error.ts:104 |
