Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

InvalidCollectionStatusTransitionError.md

229 lines4.6 KB

1---
2id: InvalidCollectionStatusTransitionError
3title: InvalidCollectionStatusTransitionError
4---
5​
6Defined in: [packages/db/src/errors.ts:118](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L118)
7​
8## Extends
9​
10- [`CollectionStateError`](CollectionStateError.md)
11​
12## Constructors
13​
14### Constructor
15​
16```ts
17new InvalidCollectionStatusTransitionError(
18 from,
19 to,
20 collectionId): InvalidCollectionStatusTransitionError;
21```
22​
23Defined in: [packages/db/src/errors.ts:119](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L119)
24​
25#### Parameters
26​
27##### from
28​
29`string`
30​
31##### to
32​
33`string`
34​
35##### collectionId
36​
37`string`
38​
39#### Returns
40​
41`InvalidCollectionStatusTransitionError`
42​
43#### Overrides
44​
45[`CollectionStateError`](CollectionStateError.md).[`constructor`](CollectionStateError.md#constructor)
46​
47## Properties
48​
49### cause?
50​
51```ts
52optional cause: unknown;
53```
54​
55Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es2022.error.d.ts:26
56​
57#### Inherited from
58​
59[`CollectionStateError`](CollectionStateError.md).[`cause`](CollectionStateError.md#cause)
60​
61***
62​
63### message
64​
65```ts
66message: string;
67```
68​
69Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1077
70​
71#### Inherited from
72​
73[`CollectionStateError`](CollectionStateError.md).[`message`](CollectionStateError.md#message)
74​
75***
76​
77### name
78​
79```ts
80name: string;
81```
82​
83Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1076
84​
85#### Inherited from
86​
87[`CollectionStateError`](CollectionStateError.md).[`name`](CollectionStateError.md#name)
88​
89***
90​
91### stack?
92​
93```ts
94optional stack: string;
95```
96​
97Defined in: node\_modules/.pnpm/typescript@5.9.3/node\_modules/typescript/lib/lib.es5.d.ts:1078
98​
99#### Inherited from
100​
101[`CollectionStateError`](CollectionStateError.md).[`stack`](CollectionStateError.md#stack)
102​
103***
104​
105### stackTraceLimit
106​
107```ts
108static stackTraceLimit: number;
109```
110​
111Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:67
112​
113The `Error.stackTraceLimit` property specifies the number of stack frames
114collected by a stack trace (whether generated by `new Error().stack` or
115`Error.captureStackTrace(obj)`).
116​
117The default value is `10` but may be set to any valid JavaScript number. Changes
118will affect any stack trace captured _after_ the value has been changed.
119​
120If set to a non-number value, or set to a negative number, stack traces will
121not capture any frames.
122​
123#### Inherited from
124​
125[`CollectionStateError`](CollectionStateError.md).[`stackTraceLimit`](CollectionStateError.md#stacktracelimit)
126​
127## Methods
128​
129### captureStackTrace()
130​
131```ts
132static captureStackTrace(targetObject, constructorOpt?): void;
133```
134​
135Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:51
136​
137Creates a `.stack` property on `targetObject`, which when accessed returns
138a string representing the location in the code at which
139`Error.captureStackTrace()` was called.
140​
141```js
142const myObject = {};
143Error.captureStackTrace(myObject);
144myObject.stack; // Similar to `new Error().stack`
145```
146​
147The first line of the trace will be prefixed with
148`${myObject.name}: ${myObject.message}`.
149​
150The optional `constructorOpt` argument accepts a function. If given, all frames
151above `constructorOpt`, including `constructorOpt`, will be omitted from the
152generated stack trace.
153​
154The `constructorOpt` argument is useful for hiding implementation
155details of error generation from the user. For instance:
156​
157```js
158function a() {
159 b();
161​
162function b() {
163 c();
165​
166function c() {
167 // Create an error without stack trace to avoid calculating the stack trace twice.
168 const { stackTraceLimit } = Error;
169 Error.stackTraceLimit = 0;
170 const error = new Error();
171 Error.stackTraceLimit = stackTraceLimit;
172​
173 // Capture the stack trace above function b
174 Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
175 throw error;
177​
178a();
179```
180​
181#### Parameters
182​
183##### targetObject
184​
185`object`
186​
187##### constructorOpt?
188​
189`Function`
190​
191#### Returns
192​
193`void`
194​
195#### Inherited from
196​
197[`CollectionStateError`](CollectionStateError.md).[`captureStackTrace`](CollectionStateError.md#capturestacktrace)
198​
199***
200​
201### prepareStackTrace()
202​
203```ts
204static prepareStackTrace(err, stackTraces): any;
205```
206​
207Defined in: node\_modules/.pnpm/@types+node@25.2.2/node\_modules/@types/node/globals.d.ts:55
208​
209#### Parameters
210​
211##### err
212​
213`Error`
214​
215##### stackTraces
216​
217`CallSite`[]
218​
219#### Returns
220​
221`any`
222​
223#### See
224​
225https://v8.dev/docs/stack-trace-api#customizing-stack-traces
226​
227#### Inherited from
228​
229[`CollectionStateError`](CollectionStateError.md).[`prepareStackTrace`](CollectionStateError.md#preparestacktrace)