跳到主要内容

RxDBMixedVersionedCacheTransactionError

Defined in: packages/rxdb/src/RxDBError.ts:202

一次批量修改混入了 QueryCache 实体与版本化(Full / Filter)实体。

Remarks​

两者的写语义不可调和:版本化实体写本地并进 changelog,QueryCache 实体先写远端再落可丢弃缓存。 同批执行只会得到「一半进了变更历史、一半没有」,因此在入口拒绝,由调用方分批。

code 而非 name 是本类的判别位:该字符串由 US-306 FR-046 指定,跨故事复用, 不得改名。它也是 @aiao/rxdb-plugin-working-tree 那张 CommitErrorCode 码表里的一条—— 但本类先于那张表存在,而且本类属于核心:核心为了一个字符串反向依赖插件,等于把 「不装插件」这件事变成不可能。所以这里写字面量,不从码表取。

两边不会漂:那张码表是 const 对象不是 enum(它的

Fileoverview​

自陈,正是为了迁就本类 早就在用的裸字面量),成员的静态类型就是普通字符串字面量,于是两侧逐值兼容;且码表那侧 有一条钉死键值逐字相同的测试。

其余各包的新错误仍按「类名主判别」,不要照抄本类。

Extends​

Extended by​

Constructors​

Constructor​

new RxDBMixedVersionedCacheTransactionError(cacheEntities, versionedEntities): RxDBMixedVersionedCacheTransactionError;

Defined in: packages/rxdb/src/RxDBError.ts:206

Parameters​

ParameterTypeDescription
cacheEntitiesreadonly string[]本批中走 QueryCache 的实体名
versionedEntitiesreadonly string[]本批中走版本化同步的实体名

Returns​

RxDBMixedVersionedCacheTransactionError

Overrides​

RxDBError.constructor

Properties​

cacheEntities​

readonly cacheEntities: readonly string[];

Defined in: packages/rxdb/src/RxDBError.ts:208

本批中走 QueryCache 的实体名


cause?​

optional cause?: unknown;

Defined in: node_modules/.pnpm/typescript@6.0.3_patch_hash=ef3c2292deb88eb14130359d5acc1febc0226af46b7b945db6c7250c6cb4efbb/node_modules/typescript/lib/lib.es2022.error.d.ts:24

Inherited from​

RxDBError.cause


code​

readonly code: "mixed_versioned_cache_transaction" = 'mixed_versioned_cache_transaction';

Defined in: packages/rxdb/src/RxDBError.ts:204

US-306 FR-046 指定的稳定错误码;写字面量而非取自码表的理由见本类

Remarks​


message​

message: string;

Defined in: node_modules/.pnpm/typescript@6.0.3_patch_hash=ef3c2292deb88eb14130359d5acc1febc0226af46b7b945db6c7250c6cb4efbb/node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from​

RxDBError.message


name​

name: string;

Defined in: node_modules/.pnpm/typescript@6.0.3_patch_hash=ef3c2292deb88eb14130359d5acc1febc0226af46b7b945db6c7250c6cb4efbb/node_modules/typescript/lib/lib.es5.d.ts:1074

Inherited from​

RxDBError.name


stack?​

optional stack?: string;

Defined in: node_modules/.pnpm/typescript@6.0.3_patch_hash=ef3c2292deb88eb14130359d5acc1febc0226af46b7b945db6c7250c6cb4efbb/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from​

RxDBError.stack


versionedEntities​

readonly versionedEntities: readonly string[];

Defined in: packages/rxdb/src/RxDBError.ts:210

本批中走版本化同步的实体名


stackTraceLimit​

static stackTraceLimit: number;

Defined in: node_modules/.pnpm/@types+node@26.6.3/node_modules/@types/node/globals.d.ts:67

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from​

RxDBError.stackTraceLimit

Methods​

captureStackTrace()​

static captureStackTrace(targetObject, constructorOpt?): void;

Defined in: node_modules/.pnpm/@types+node@26.6.3/node_modules/@types/node/globals.d.ts:51

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

function a() {
b();
}

function b() {
c();
}

function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;

// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}

a();

Parameters​

ParameterType
targetObjectobject
constructorOpt?Function

Returns​

void

Inherited from​

RxDBError.captureStackTrace


prepareStackTrace()​

static prepareStackTrace(err, stackTraces): any;

Defined in: node_modules/.pnpm/@types+node@26.6.3/node_modules/@types/node/globals.d.ts:55

Parameters​

ParameterType
errError
stackTracesCallSite[]

Returns​

any

See​

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from​

RxDBError.prepareStackTrace