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

ObjectStoreNotFoundError.md

247 lines4.0 KB

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