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

InvalidCollectionStatusTransitionError.md

231 lines4.6 KB

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