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

duplicatekeyerror.md

172 lines3.3 KB

1---
2id: DuplicateKeyError
3title: DuplicateKeyError
4---
5​
6<!-- DO NOT EDIT: this page is autogenerated from the type comments -->
7​
8# Class: DuplicateKeyError
9​
10Defined in: [packages/db/src/errors.ts:128](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L128)
11​
12## Extends
13​
14- [`CollectionOperationError`](../collectionoperationerror.md)
15​
16## Constructors
17​
18### new DuplicateKeyError()
19​
20```ts
21new DuplicateKeyError(key): DuplicateKeyError
22```
23​
24Defined in: [packages/db/src/errors.ts:129](https://github.com/TanStack/db/blob/main/packages/db/src/errors.ts#L129)
25​
26#### Parameters
27​
28##### key
29​
30`string` | `number`
31​
32#### Returns
33​
34[`DuplicateKeyError`](../duplicatekeyerror.md)
35​
36#### Overrides
37​
38[`CollectionOperationError`](../collectionoperationerror.md).[`constructor`](../CollectionOperationError.md#constructors)
39​
40## Properties
41​
42### cause?
43​
44```ts
45optional cause: unknown;
46```
47​
48Defined in: node\_modules/.pnpm/typescript@5.8.2/node\_modules/typescript/lib/lib.es2022.error.d.ts:26
49​
50#### Inherited from
51​
52[`CollectionOperationError`](../collectionoperationerror.md).[`cause`](../CollectionOperationError.md#cause)
53​
54***
55​
56### message
57​
58```ts
59message: string;
60```
61​
62Defined in: node\_modules/.pnpm/typescript@5.8.2/node\_modules/typescript/lib/lib.es5.d.ts:1077
63​
64#### Inherited from
65​
66[`CollectionOperationError`](../collectionoperationerror.md).[`message`](../CollectionOperationError.md#message-1)
67​
68***
69​
70### name
71​
72```ts
73name: string;
74```
75​
76Defined in: node\_modules/.pnpm/typescript@5.8.2/node\_modules/typescript/lib/lib.es5.d.ts:1076
77​
78#### Inherited from
79​
80[`CollectionOperationError`](../collectionoperationerror.md).[`name`](../CollectionOperationError.md#name)
81​
82***
83​
84### stack?
85​
86```ts
87optional stack: string;
88```
89​
90Defined in: node\_modules/.pnpm/typescript@5.8.2/node\_modules/typescript/lib/lib.es5.d.ts:1078
91​
92#### Inherited from
93​
94[`CollectionOperationError`](../collectionoperationerror.md).[`stack`](../CollectionOperationError.md#stack)
95​
96***
97​
98### prepareStackTrace()?
99​
100```ts
101static optional prepareStackTrace: (err, stackTraces) => any;
102```
103​
104Defined in: node\_modules/.pnpm/@types+node@22.13.10/node\_modules/@types/node/globals.d.ts:143
105​
106Optional override for formatting stack traces
107​
108#### Parameters
109​
110##### err
111​
112`Error`
113​
114##### stackTraces
115​
116`CallSite`[]
117​
118#### Returns
119​
120`any`
121​
122#### See
123​
124https://v8.dev/docs/stack-trace-api#customizing-stack-traces
125​
126#### Inherited from
127​
128[`CollectionOperationError`](../collectionoperationerror.md).[`prepareStackTrace`](../CollectionOperationError.md#preparestacktrace)
129​
130***
131​
132### stackTraceLimit
133​
134```ts
135static stackTraceLimit: number;
136```
137​
138Defined in: node\_modules/.pnpm/@types+node@22.13.10/node\_modules/@types/node/globals.d.ts:145
139​
140#### Inherited from
141​
142[`CollectionOperationError`](../collectionoperationerror.md).[`stackTraceLimit`](../CollectionOperationError.md#stacktracelimit)
143​
144## Methods
145​
146### captureStackTrace()
147​
148```ts
149static captureStackTrace(targetObject, constructorOpt?): void
150```
151​
152Defined in: node\_modules/.pnpm/@types+node@22.13.10/node\_modules/@types/node/globals.d.ts:136
153​
154Create .stack property on a target object
155​
156#### Parameters
157​
158##### targetObject
159​
160`object`
161​
162##### constructorOpt?
163​
164`Function`
165​
166#### Returns
167​
168`void`
169​
170#### Inherited from
171​
172[`CollectionOperationError`](../collectionoperationerror.md).[`captureStackTrace`](../CollectionOperationError.md#capturestacktrace)