@databricks/appkit 0.44.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +1 -0
- package/dist/agents/databricks.d.ts +25 -1
- package/dist/agents/databricks.d.ts.map +1 -1
- package/dist/agents/databricks.js +20 -1
- package/dist/agents/databricks.js.map +1 -1
- package/dist/appkit/package.js +1 -1
- package/dist/beta.d.ts +2 -2
- package/dist/connectors/sql-warehouse/arrow-schema.js +283 -0
- package/dist/connectors/sql-warehouse/arrow-schema.js.map +1 -0
- package/dist/connectors/sql-warehouse/client.js +166 -60
- package/dist/connectors/sql-warehouse/client.js.map +1 -1
- package/dist/core/agent/load-agents.d.ts.map +1 -1
- package/dist/core/agent/load-agents.js +52 -0
- package/dist/core/agent/load-agents.js.map +1 -1
- package/dist/core/agent/types.d.ts +11 -0
- package/dist/core/agent/types.d.ts.map +1 -1
- package/dist/core/agent/types.js.map +1 -1
- package/dist/core/appkit.d.ts.map +1 -1
- package/dist/core/appkit.js +2 -0
- package/dist/core/appkit.js.map +1 -1
- package/dist/core/lifecycle-manager.js +183 -0
- package/dist/core/lifecycle-manager.js.map +1 -0
- package/dist/core/plugin-context.d.ts +19 -1
- package/dist/core/plugin-context.d.ts.map +1 -1
- package/dist/core/plugin-context.js +9 -3
- package/dist/core/plugin-context.js.map +1 -1
- package/dist/errors/base.d.ts +18 -0
- package/dist/errors/base.d.ts.map +1 -1
- package/dist/errors/base.js +20 -0
- package/dist/errors/base.js.map +1 -1
- package/dist/errors/execution.d.ts +34 -2
- package/dist/errors/execution.d.ts.map +1 -1
- package/dist/errors/execution.js +40 -5
- package/dist/errors/execution.js.map +1 -1
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +2 -1
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/plugins/agents/agents.d.ts.map +1 -1
- package/dist/plugins/agents/agents.js +3 -3
- package/dist/plugins/agents/agents.js.map +1 -1
- package/dist/plugins/analytics/analytics.d.ts +84 -8
- package/dist/plugins/analytics/analytics.d.ts.map +1 -1
- package/dist/plugins/analytics/analytics.js +296 -61
- package/dist/plugins/analytics/analytics.js.map +1 -1
- package/dist/plugins/analytics/index.js +1 -1
- package/dist/plugins/analytics/result-delivery.js +287 -0
- package/dist/plugins/analytics/result-delivery.js.map +1 -0
- package/dist/plugins/analytics/types.d.ts +8 -0
- package/dist/plugins/analytics/types.d.ts.map +1 -1
- package/dist/plugins/analytics/types.js.map +1 -1
- package/dist/plugins/files/plugin.js +1 -1
- package/dist/plugins/genie/genie.js +1 -1
- package/dist/plugins/jobs/types.d.ts +1 -1
- package/dist/plugins/lakebase/lakebase.d.ts +10 -2
- package/dist/plugins/lakebase/lakebase.d.ts.map +1 -1
- package/dist/plugins/lakebase/lakebase.js +19 -8
- package/dist/plugins/lakebase/lakebase.js.map +1 -1
- package/dist/plugins/server/index.d.ts +51 -1
- package/dist/plugins/server/index.d.ts.map +1 -1
- package/dist/plugins/server/index.js +110 -23
- package/dist/plugins/server/index.js.map +1 -1
- package/dist/registry/resource-registry.d.ts +9 -1
- package/dist/registry/resource-registry.d.ts.map +1 -1
- package/dist/registry/resource-registry.js +22 -5
- package/dist/registry/resource-registry.js.map +1 -1
- package/dist/shared/src/execute.d.ts +1 -3
- package/dist/shared/src/execute.d.ts.map +1 -1
- package/dist/shared/src/index.d.ts +1 -0
- package/dist/shared/src/plugin.d.ts +16 -0
- package/dist/shared/src/plugin.d.ts.map +1 -1
- package/dist/shared/src/sse/analytics.d.ts +1 -0
- package/dist/shared/src/sse/analytics.js +40 -0
- package/dist/shared/src/sse/analytics.js.map +1 -0
- package/dist/stream/arrow-stream-processor.js +93 -117
- package/dist/stream/arrow-stream-processor.js.map +1 -1
- package/dist/stream/buffers.js +1 -1
- package/dist/stream/buffers.js.map +1 -1
- package/dist/stream/defaults.js +1 -3
- package/dist/stream/defaults.js.map +1 -1
- package/dist/stream/sse-writer.js +3 -2
- package/dist/stream/sse-writer.js.map +1 -1
- package/dist/stream/stream-manager.d.ts +2 -2
- package/dist/stream/stream-manager.d.ts.map +1 -1
- package/dist/stream/stream-manager.js +41 -33
- package/dist/stream/stream-manager.js.map +1 -1
- package/dist/stream/stream-registry.js +30 -23
- package/dist/stream/stream-registry.js.map +1 -1
- package/dist/stream/timers.js +17 -0
- package/dist/stream/timers.js.map +1 -0
- package/dist/stream/types.js.map +1 -1
- package/dist/telemetry/telemetry-manager.js +19 -13
- package/dist/telemetry/telemetry-manager.js.map +1 -1
- package/dist/type-generator/query-registry.js +32 -2
- package/dist/type-generator/query-registry.js.map +1 -1
- package/dist/utils/safe-handler.js +28 -0
- package/dist/utils/safe-handler.js.map +1 -0
- package/docs/api/appkit/Class.AppKitError.md +40 -8
- package/docs/api/appkit/Class.AuthenticationError.md +56 -16
- package/docs/api/appkit/Class.ConfigurationError.md +57 -17
- package/docs/api/appkit/Class.ConnectionError.md +57 -17
- package/docs/api/appkit/Class.ExecutionError.md +80 -22
- package/docs/api/appkit/Class.InitializationError.md +55 -15
- package/docs/api/appkit/Class.Plugin.md +2 -0
- package/docs/api/appkit/Class.ResourceRegistry.md +1 -1
- package/docs/api/appkit/Class.ServerError.md +55 -15
- package/docs/api/appkit/Class.TunnelError.md +56 -16
- package/docs/api/appkit/Class.ValidationError.md +55 -15
- package/docs/api/appkit/Interface.AgentDefinition.md +11 -0
- package/docs/api/appkit/Interface.GenerationParams.md +58 -0
- package/docs/api/appkit/Interface.RegisteredAgent.md +11 -0
- package/docs/api/appkit.md +1 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
|
@@ -21,6 +21,7 @@ throw new ConfigurationError("Warehouse ID not found", { context: { env: "produc
|
|
|
21
21
|
```ts
|
|
22
22
|
new ConfigurationError(message: string, options?: {
|
|
23
23
|
cause?: Error;
|
|
24
|
+
clientMessage?: string;
|
|
24
25
|
context?: Record<string, unknown>;
|
|
25
26
|
}): ConfigurationError;
|
|
26
27
|
|
|
@@ -28,12 +29,13 @@ new ConfigurationError(message: string, options?: {
|
|
|
28
29
|
|
|
29
30
|
#### Parameters[](#parameters "Direct link to Parameters")
|
|
30
31
|
|
|
31
|
-
| Parameter
|
|
32
|
-
|
|
|
33
|
-
| `message`
|
|
34
|
-
| `options?`
|
|
35
|
-
| `options.cause?`
|
|
36
|
-
| `options.
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ------------------------ | --------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `message` | `string` |
|
|
35
|
+
| `options?` | { `cause?`: `Error`; `clientMessage?`: `string`; `context?`: `Record`<`string`, `unknown`>; } |
|
|
36
|
+
| `options.cause?` | `Error` |
|
|
37
|
+
| `options.clientMessage?` | `string` |
|
|
38
|
+
| `options.context?` | `Record`<`string`, `unknown`> |
|
|
37
39
|
|
|
38
40
|
#### Returns[](#returns "Direct link to Returns")
|
|
39
41
|
|
|
@@ -45,6 +47,23 @@ new ConfigurationError(message: string, options?: {
|
|
|
45
47
|
|
|
46
48
|
## Properties[](#properties "Direct link to Properties")
|
|
47
49
|
|
|
50
|
+
### \_clientMessage?[](#_clientmessage "Direct link to _clientMessage?")
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
protected readonly optional _clientMessage: string;
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Client-safe error message. When set, callers serializing the error to a client (SSE, HTTP body) MUST prefer `clientMessage` over `message` — `message` may contain raw upstream / SDK text including statement fragments, internal object names, and correlation IDs.
|
|
58
|
+
|
|
59
|
+
Subclasses can set this in their constructor for a fixed sanitized string. When unset, `clientMessage` defaults to a generic per-code string (see the getter), and the raw `message` is kept server-side only.
|
|
60
|
+
|
|
61
|
+
#### Inherited from[](#inherited-from-1 "Direct link to Inherited from")
|
|
62
|
+
|
|
63
|
+
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`_clientMessage`](./docs/api/appkit/Class.AppKitError.md#_clientmessage)
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
48
67
|
### cause?[](#cause "Direct link to cause?")
|
|
49
68
|
|
|
50
69
|
```ts
|
|
@@ -54,7 +73,7 @@ readonly optional cause: Error;
|
|
|
54
73
|
|
|
55
74
|
Optional cause of the error
|
|
56
75
|
|
|
57
|
-
#### Inherited from[](#inherited-from-
|
|
76
|
+
#### Inherited from[](#inherited-from-2 "Direct link to Inherited from")
|
|
58
77
|
|
|
59
78
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`cause`](./docs/api/appkit/Class.AppKitError.md#cause)
|
|
60
79
|
|
|
@@ -84,7 +103,7 @@ readonly optional context: Record<string, unknown>;
|
|
|
84
103
|
|
|
85
104
|
Additional context for the error
|
|
86
105
|
|
|
87
|
-
#### Inherited from[](#inherited-from-
|
|
106
|
+
#### Inherited from[](#inherited-from-3 "Direct link to Inherited from")
|
|
88
107
|
|
|
89
108
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`context`](./docs/api/appkit/Class.AppKitError.md#context)
|
|
90
109
|
|
|
@@ -118,6 +137,27 @@ HTTP status code suggestion (can be overridden)
|
|
|
118
137
|
|
|
119
138
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`statusCode`](./docs/api/appkit/Class.AppKitError.md#statuscode)
|
|
120
139
|
|
|
140
|
+
## Accessors[](#accessors "Direct link to Accessors")
|
|
141
|
+
|
|
142
|
+
### clientMessage[](#clientmessage "Direct link to clientMessage")
|
|
143
|
+
|
|
144
|
+
#### Get Signature[](#get-signature "Direct link to Get Signature")
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
get clientMessage(): string;
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Sanitized message safe to forward to clients. Override in subclasses if a more specific default is appropriate.
|
|
152
|
+
|
|
153
|
+
##### Returns[](#returns-1 "Direct link to Returns")
|
|
154
|
+
|
|
155
|
+
`string`
|
|
156
|
+
|
|
157
|
+
#### Inherited from[](#inherited-from-4 "Direct link to Inherited from")
|
|
158
|
+
|
|
159
|
+
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`clientMessage`](./docs/api/appkit/Class.AppKitError.md#clientmessage)
|
|
160
|
+
|
|
121
161
|
## Methods[](#methods "Direct link to Methods")
|
|
122
162
|
|
|
123
163
|
### toJSON()[](#tojson "Direct link to toJSON()")
|
|
@@ -129,11 +169,11 @@ toJSON(): Record<string, unknown>;
|
|
|
129
169
|
|
|
130
170
|
Convert error to JSON for logging/serialization. Sensitive values in context are automatically redacted.
|
|
131
171
|
|
|
132
|
-
#### Returns[](#returns-
|
|
172
|
+
#### Returns[](#returns-2 "Direct link to Returns")
|
|
133
173
|
|
|
134
174
|
`Record`<`string`, `unknown`>
|
|
135
175
|
|
|
136
|
-
#### Inherited from[](#inherited-from-
|
|
176
|
+
#### Inherited from[](#inherited-from-5 "Direct link to Inherited from")
|
|
137
177
|
|
|
138
178
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`toJSON`](./docs/api/appkit/Class.AppKitError.md#tojson)
|
|
139
179
|
|
|
@@ -148,11 +188,11 @@ toString(): string;
|
|
|
148
188
|
|
|
149
189
|
Create a human-readable string representation
|
|
150
190
|
|
|
151
|
-
#### Returns[](#returns-
|
|
191
|
+
#### Returns[](#returns-3 "Direct link to Returns")
|
|
152
192
|
|
|
153
193
|
`string`
|
|
154
194
|
|
|
155
|
-
#### Inherited from[](#inherited-from-
|
|
195
|
+
#### Inherited from[](#inherited-from-6 "Direct link to Inherited from")
|
|
156
196
|
|
|
157
197
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`toString`](./docs/api/appkit/Class.AppKitError.md#tostring)
|
|
158
198
|
|
|
@@ -179,7 +219,7 @@ By default the message is short; key lines use **picocolors** when the terminal
|
|
|
179
219
|
| `options?` | { `cause?`: `Error`; } |
|
|
180
220
|
| `options.cause?` | `Error` |
|
|
181
221
|
|
|
182
|
-
#### Returns[](#returns-
|
|
222
|
+
#### Returns[](#returns-4 "Direct link to Returns")
|
|
183
223
|
|
|
184
224
|
`ConfigurationError`
|
|
185
225
|
|
|
@@ -201,7 +241,7 @@ Create a configuration error for invalid connection config
|
|
|
201
241
|
| `service` | `string` |
|
|
202
242
|
| `details?` | `string` |
|
|
203
243
|
|
|
204
|
-
#### Returns[](#returns-
|
|
244
|
+
#### Returns[](#returns-5 "Direct link to Returns")
|
|
205
245
|
|
|
206
246
|
`ConfigurationError`
|
|
207
247
|
|
|
@@ -222,7 +262,7 @@ Create a configuration error for missing connection string parameter
|
|
|
222
262
|
| --------- | -------- |
|
|
223
263
|
| `param` | `string` |
|
|
224
264
|
|
|
225
|
-
#### Returns[](#returns-
|
|
265
|
+
#### Returns[](#returns-6 "Direct link to Returns")
|
|
226
266
|
|
|
227
267
|
`ConfigurationError`
|
|
228
268
|
|
|
@@ -243,7 +283,7 @@ Create a configuration error for missing environment variable
|
|
|
243
283
|
| --------- | -------- |
|
|
244
284
|
| `varName` | `string` |
|
|
245
285
|
|
|
246
|
-
#### Returns[](#returns-
|
|
286
|
+
#### Returns[](#returns-7 "Direct link to Returns")
|
|
247
287
|
|
|
248
288
|
`ConfigurationError`
|
|
249
289
|
|
|
@@ -265,6 +305,6 @@ Create a configuration error for missing resource
|
|
|
265
305
|
| `resource` | `string` |
|
|
266
306
|
| `hint?` | `string` |
|
|
267
307
|
|
|
268
|
-
#### Returns[](#returns-
|
|
308
|
+
#### Returns[](#returns-8 "Direct link to Returns")
|
|
269
309
|
|
|
270
310
|
`ConfigurationError`
|
|
@@ -21,6 +21,7 @@ throw new ConnectionError("No response received from SQL Warehouse API");
|
|
|
21
21
|
```ts
|
|
22
22
|
new ConnectionError(message: string, options?: {
|
|
23
23
|
cause?: Error;
|
|
24
|
+
clientMessage?: string;
|
|
24
25
|
context?: Record<string, unknown>;
|
|
25
26
|
}): ConnectionError;
|
|
26
27
|
|
|
@@ -28,12 +29,13 @@ new ConnectionError(message: string, options?: {
|
|
|
28
29
|
|
|
29
30
|
#### Parameters[](#parameters "Direct link to Parameters")
|
|
30
31
|
|
|
31
|
-
| Parameter
|
|
32
|
-
|
|
|
33
|
-
| `message`
|
|
34
|
-
| `options?`
|
|
35
|
-
| `options.cause?`
|
|
36
|
-
| `options.
|
|
32
|
+
| Parameter | Type |
|
|
33
|
+
| ------------------------ | --------------------------------------------------------------------------------------------- |
|
|
34
|
+
| `message` | `string` |
|
|
35
|
+
| `options?` | { `cause?`: `Error`; `clientMessage?`: `string`; `context?`: `Record`<`string`, `unknown`>; } |
|
|
36
|
+
| `options.cause?` | `Error` |
|
|
37
|
+
| `options.clientMessage?` | `string` |
|
|
38
|
+
| `options.context?` | `Record`<`string`, `unknown`> |
|
|
37
39
|
|
|
38
40
|
#### Returns[](#returns "Direct link to Returns")
|
|
39
41
|
|
|
@@ -45,6 +47,23 @@ new ConnectionError(message: string, options?: {
|
|
|
45
47
|
|
|
46
48
|
## Properties[](#properties "Direct link to Properties")
|
|
47
49
|
|
|
50
|
+
### \_clientMessage?[](#_clientmessage "Direct link to _clientMessage?")
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
protected readonly optional _clientMessage: string;
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Client-safe error message. When set, callers serializing the error to a client (SSE, HTTP body) MUST prefer `clientMessage` over `message` — `message` may contain raw upstream / SDK text including statement fragments, internal object names, and correlation IDs.
|
|
58
|
+
|
|
59
|
+
Subclasses can set this in their constructor for a fixed sanitized string. When unset, `clientMessage` defaults to a generic per-code string (see the getter), and the raw `message` is kept server-side only.
|
|
60
|
+
|
|
61
|
+
#### Inherited from[](#inherited-from-1 "Direct link to Inherited from")
|
|
62
|
+
|
|
63
|
+
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`_clientMessage`](./docs/api/appkit/Class.AppKitError.md#_clientmessage)
|
|
64
|
+
|
|
65
|
+
***
|
|
66
|
+
|
|
48
67
|
### cause?[](#cause "Direct link to cause?")
|
|
49
68
|
|
|
50
69
|
```ts
|
|
@@ -54,7 +73,7 @@ readonly optional cause: Error;
|
|
|
54
73
|
|
|
55
74
|
Optional cause of the error
|
|
56
75
|
|
|
57
|
-
#### Inherited from[](#inherited-from-
|
|
76
|
+
#### Inherited from[](#inherited-from-2 "Direct link to Inherited from")
|
|
58
77
|
|
|
59
78
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`cause`](./docs/api/appkit/Class.AppKitError.md#cause)
|
|
60
79
|
|
|
@@ -84,7 +103,7 @@ readonly optional context: Record<string, unknown>;
|
|
|
84
103
|
|
|
85
104
|
Additional context for the error
|
|
86
105
|
|
|
87
|
-
#### Inherited from[](#inherited-from-
|
|
106
|
+
#### Inherited from[](#inherited-from-3 "Direct link to Inherited from")
|
|
88
107
|
|
|
89
108
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`context`](./docs/api/appkit/Class.AppKitError.md#context)
|
|
90
109
|
|
|
@@ -118,6 +137,27 @@ HTTP status code suggestion (can be overridden)
|
|
|
118
137
|
|
|
119
138
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`statusCode`](./docs/api/appkit/Class.AppKitError.md#statuscode)
|
|
120
139
|
|
|
140
|
+
## Accessors[](#accessors "Direct link to Accessors")
|
|
141
|
+
|
|
142
|
+
### clientMessage[](#clientmessage "Direct link to clientMessage")
|
|
143
|
+
|
|
144
|
+
#### Get Signature[](#get-signature "Direct link to Get Signature")
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
get clientMessage(): string;
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Sanitized message safe to forward to clients. Override in subclasses if a more specific default is appropriate.
|
|
152
|
+
|
|
153
|
+
##### Returns[](#returns-1 "Direct link to Returns")
|
|
154
|
+
|
|
155
|
+
`string`
|
|
156
|
+
|
|
157
|
+
#### Inherited from[](#inherited-from-4 "Direct link to Inherited from")
|
|
158
|
+
|
|
159
|
+
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`clientMessage`](./docs/api/appkit/Class.AppKitError.md#clientmessage)
|
|
160
|
+
|
|
121
161
|
## Methods[](#methods "Direct link to Methods")
|
|
122
162
|
|
|
123
163
|
### toJSON()[](#tojson "Direct link to toJSON()")
|
|
@@ -129,11 +169,11 @@ toJSON(): Record<string, unknown>;
|
|
|
129
169
|
|
|
130
170
|
Convert error to JSON for logging/serialization. Sensitive values in context are automatically redacted.
|
|
131
171
|
|
|
132
|
-
#### Returns[](#returns-
|
|
172
|
+
#### Returns[](#returns-2 "Direct link to Returns")
|
|
133
173
|
|
|
134
174
|
`Record`<`string`, `unknown`>
|
|
135
175
|
|
|
136
|
-
#### Inherited from[](#inherited-from-
|
|
176
|
+
#### Inherited from[](#inherited-from-5 "Direct link to Inherited from")
|
|
137
177
|
|
|
138
178
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`toJSON`](./docs/api/appkit/Class.AppKitError.md#tojson)
|
|
139
179
|
|
|
@@ -148,11 +188,11 @@ toString(): string;
|
|
|
148
188
|
|
|
149
189
|
Create a human-readable string representation
|
|
150
190
|
|
|
151
|
-
#### Returns[](#returns-
|
|
191
|
+
#### Returns[](#returns-3 "Direct link to Returns")
|
|
152
192
|
|
|
153
193
|
`string`
|
|
154
194
|
|
|
155
|
-
#### Inherited from[](#inherited-from-
|
|
195
|
+
#### Inherited from[](#inherited-from-6 "Direct link to Inherited from")
|
|
156
196
|
|
|
157
197
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`toString`](./docs/api/appkit/Class.AppKitError.md#tostring)
|
|
158
198
|
|
|
@@ -174,7 +214,7 @@ Create a connection error for API failures
|
|
|
174
214
|
| `service` | `string` |
|
|
175
215
|
| `cause?` | `Error` |
|
|
176
216
|
|
|
177
|
-
#### Returns[](#returns-
|
|
217
|
+
#### Returns[](#returns-4 "Direct link to Returns")
|
|
178
218
|
|
|
179
219
|
`ConnectionError`
|
|
180
220
|
|
|
@@ -196,7 +236,7 @@ Create a connection error for client unavailable
|
|
|
196
236
|
| `clientType` | `string` |
|
|
197
237
|
| `hint?` | `string` |
|
|
198
238
|
|
|
199
|
-
#### Returns[](#returns-
|
|
239
|
+
#### Returns[](#returns-5 "Direct link to Returns")
|
|
200
240
|
|
|
201
241
|
`ConnectionError`
|
|
202
242
|
|
|
@@ -218,7 +258,7 @@ Create a connection error for pool errors
|
|
|
218
258
|
| `operation` | `string` |
|
|
219
259
|
| `cause?` | `Error` |
|
|
220
260
|
|
|
221
|
-
#### Returns[](#returns-
|
|
261
|
+
#### Returns[](#returns-6 "Direct link to Returns")
|
|
222
262
|
|
|
223
263
|
`ConnectionError`
|
|
224
264
|
|
|
@@ -239,7 +279,7 @@ Create a connection error for query failure
|
|
|
239
279
|
| --------- | ------- |
|
|
240
280
|
| `cause?` | `Error` |
|
|
241
281
|
|
|
242
|
-
#### Returns[](#returns-
|
|
282
|
+
#### Returns[](#returns-7 "Direct link to Returns")
|
|
243
283
|
|
|
244
284
|
`ConnectionError`
|
|
245
285
|
|
|
@@ -260,6 +300,6 @@ Create a connection error for transaction failure
|
|
|
260
300
|
| --------- | ------- |
|
|
261
301
|
| `cause?` | `Error` |
|
|
262
302
|
|
|
263
|
-
#### Returns[](#returns-
|
|
303
|
+
#### Returns[](#returns-8 "Direct link to Returns")
|
|
264
304
|
|
|
265
305
|
`ConnectionError`
|
|
@@ -21,30 +21,51 @@ throw new ExecutionError("Statement was canceled");
|
|
|
21
21
|
```ts
|
|
22
22
|
new ExecutionError(message: string, options?: {
|
|
23
23
|
cause?: Error;
|
|
24
|
+
clientMessage?: string;
|
|
24
25
|
context?: Record<string, unknown>;
|
|
26
|
+
errorCode?: string;
|
|
25
27
|
}): ExecutionError;
|
|
26
28
|
|
|
27
29
|
```
|
|
28
30
|
|
|
29
31
|
#### Parameters[](#parameters "Direct link to Parameters")
|
|
30
32
|
|
|
31
|
-
| Parameter
|
|
32
|
-
|
|
|
33
|
-
| `message`
|
|
34
|
-
| `options?`
|
|
35
|
-
| `options.cause?`
|
|
36
|
-
| `options.
|
|
33
|
+
| Parameter | Type |
|
|
34
|
+
| ------------------------ | --------------------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| `message` | `string` |
|
|
36
|
+
| `options?` | { `cause?`: `Error`; `clientMessage?`: `string`; `context?`: `Record`<`string`, `unknown`>; `errorCode?`: `string`; } |
|
|
37
|
+
| `options.cause?` | `Error` |
|
|
38
|
+
| `options.clientMessage?` | `string` |
|
|
39
|
+
| `options.context?` | `Record`<`string`, `unknown`> |
|
|
40
|
+
| `options.errorCode?` | `string` |
|
|
37
41
|
|
|
38
42
|
#### Returns[](#returns "Direct link to Returns")
|
|
39
43
|
|
|
40
44
|
`ExecutionError`
|
|
41
45
|
|
|
42
|
-
####
|
|
46
|
+
#### Overrides[](#overrides "Direct link to Overrides")
|
|
43
47
|
|
|
44
48
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`constructor`](./docs/api/appkit/Class.AppKitError.md#constructor)
|
|
45
49
|
|
|
46
50
|
## Properties[](#properties "Direct link to Properties")
|
|
47
51
|
|
|
52
|
+
### \_clientMessage?[](#_clientmessage "Direct link to _clientMessage?")
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
protected readonly optional _clientMessage: string;
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Client-safe error message. When set, callers serializing the error to a client (SSE, HTTP body) MUST prefer `clientMessage` over `message` — `message` may contain raw upstream / SDK text including statement fragments, internal object names, and correlation IDs.
|
|
60
|
+
|
|
61
|
+
Subclasses can set this in their constructor for a fixed sanitized string. When unset, `clientMessage` defaults to a generic per-code string (see the getter), and the raw `message` is kept server-side only.
|
|
62
|
+
|
|
63
|
+
#### Inherited from[](#inherited-from "Direct link to Inherited from")
|
|
64
|
+
|
|
65
|
+
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`_clientMessage`](./docs/api/appkit/Class.AppKitError.md#_clientmessage)
|
|
66
|
+
|
|
67
|
+
***
|
|
68
|
+
|
|
48
69
|
### cause?[](#cause "Direct link to cause?")
|
|
49
70
|
|
|
50
71
|
```ts
|
|
@@ -69,7 +90,7 @@ readonly code: "EXECUTION_ERROR" = "EXECUTION_ERROR";
|
|
|
69
90
|
|
|
70
91
|
Error code for programmatic error handling
|
|
71
92
|
|
|
72
|
-
#### Overrides[](#overrides "Direct link to Overrides")
|
|
93
|
+
#### Overrides[](#overrides-1 "Direct link to Overrides")
|
|
73
94
|
|
|
74
95
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`code`](./docs/api/appkit/Class.AppKitError.md#code)
|
|
75
96
|
|
|
@@ -90,6 +111,17 @@ Additional context for the error
|
|
|
90
111
|
|
|
91
112
|
***
|
|
92
113
|
|
|
114
|
+
### errorCode?[](#errorcode "Direct link to errorCode?")
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
readonly optional errorCode: string;
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Structured error code from the upstream source (typically the warehouse's `error_code` for statement-level failures, or the SDK's `ApiError.errorCode` for HTTP failures). Preserved through wrapping so callers can branch on a stable identifier without substring-matching the message.
|
|
122
|
+
|
|
123
|
+
***
|
|
124
|
+
|
|
93
125
|
### isRetryable[](#isretryable "Direct link to isRetryable")
|
|
94
126
|
|
|
95
127
|
```ts
|
|
@@ -99,7 +131,7 @@ readonly isRetryable: false = false;
|
|
|
99
131
|
|
|
100
132
|
Whether this error type is generally safe to retry
|
|
101
133
|
|
|
102
|
-
#### Overrides[](#overrides-
|
|
134
|
+
#### Overrides[](#overrides-2 "Direct link to Overrides")
|
|
103
135
|
|
|
104
136
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`isRetryable`](./docs/api/appkit/Class.AppKitError.md#isretryable)
|
|
105
137
|
|
|
@@ -114,10 +146,31 @@ readonly statusCode: 500 = 500;
|
|
|
114
146
|
|
|
115
147
|
HTTP status code suggestion (can be overridden)
|
|
116
148
|
|
|
117
|
-
#### Overrides[](#overrides-
|
|
149
|
+
#### Overrides[](#overrides-3 "Direct link to Overrides")
|
|
118
150
|
|
|
119
151
|
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`statusCode`](./docs/api/appkit/Class.AppKitError.md#statuscode)
|
|
120
152
|
|
|
153
|
+
## Accessors[](#accessors "Direct link to Accessors")
|
|
154
|
+
|
|
155
|
+
### clientMessage[](#clientmessage "Direct link to clientMessage")
|
|
156
|
+
|
|
157
|
+
#### Get Signature[](#get-signature "Direct link to Get Signature")
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
get clientMessage(): string;
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Execution errors default to a generic message — the raw warehouse / SDK text in `.message` often includes statement fragments, internal paths, and correlation IDs. UI code should branch on `errorCode` (`RESULT_TOO_LARGE_FOR_JSON_FALLBACK`, `NOT_IMPLEMENTED`, etc.) and not on the human string.
|
|
165
|
+
|
|
166
|
+
##### Returns[](#returns-1 "Direct link to Returns")
|
|
167
|
+
|
|
168
|
+
`string`
|
|
169
|
+
|
|
170
|
+
#### Overrides[](#overrides-4 "Direct link to Overrides")
|
|
171
|
+
|
|
172
|
+
[`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`clientMessage`](./docs/api/appkit/Class.AppKitError.md#clientmessage)
|
|
173
|
+
|
|
121
174
|
## Methods[](#methods "Direct link to Methods")
|
|
122
175
|
|
|
123
176
|
### toJSON()[](#tojson "Direct link to toJSON()")
|
|
@@ -129,7 +182,7 @@ toJSON(): Record<string, unknown>;
|
|
|
129
182
|
|
|
130
183
|
Convert error to JSON for logging/serialization. Sensitive values in context are automatically redacted.
|
|
131
184
|
|
|
132
|
-
#### Returns[](#returns-
|
|
185
|
+
#### Returns[](#returns-2 "Direct link to Returns")
|
|
133
186
|
|
|
134
187
|
`Record`<`string`, `unknown`>
|
|
135
188
|
|
|
@@ -148,7 +201,7 @@ toString(): string;
|
|
|
148
201
|
|
|
149
202
|
Create a human-readable string representation
|
|
150
203
|
|
|
151
|
-
#### Returns[](#returns-
|
|
204
|
+
#### Returns[](#returns-3 "Direct link to Returns")
|
|
152
205
|
|
|
153
206
|
`string`
|
|
154
207
|
|
|
@@ -167,7 +220,7 @@ static canceled(): ExecutionError;
|
|
|
167
220
|
|
|
168
221
|
Create an execution error for canceled operation
|
|
169
222
|
|
|
170
|
-
#### Returns[](#returns-
|
|
223
|
+
#### Returns[](#returns-4 "Direct link to Returns")
|
|
171
224
|
|
|
172
225
|
`ExecutionError`
|
|
173
226
|
|
|
@@ -188,7 +241,7 @@ Create an execution error for missing data
|
|
|
188
241
|
| ---------- | -------- |
|
|
189
242
|
| `dataType` | `string` |
|
|
190
243
|
|
|
191
|
-
#### Returns[](#returns-
|
|
244
|
+
#### Returns[](#returns-5 "Direct link to Returns")
|
|
192
245
|
|
|
193
246
|
`ExecutionError`
|
|
194
247
|
|
|
@@ -203,7 +256,7 @@ static resultsClosed(): ExecutionError;
|
|
|
203
256
|
|
|
204
257
|
Create an execution error for closed/expired results
|
|
205
258
|
|
|
206
|
-
#### Returns[](#returns-
|
|
259
|
+
#### Returns[](#returns-6 "Direct link to Returns")
|
|
207
260
|
|
|
208
261
|
`ExecutionError`
|
|
209
262
|
|
|
@@ -212,19 +265,24 @@ Create an execution error for closed/expired results
|
|
|
212
265
|
### statementFailed()[](#statementfailed "Direct link to statementFailed()")
|
|
213
266
|
|
|
214
267
|
```ts
|
|
215
|
-
static statementFailed(
|
|
268
|
+
static statementFailed(
|
|
269
|
+
errorMessage?: string,
|
|
270
|
+
errorCode?: string,
|
|
271
|
+
clientMessage?: string): ExecutionError;
|
|
216
272
|
|
|
217
273
|
```
|
|
218
274
|
|
|
219
|
-
Create an execution error for statement failure
|
|
275
|
+
Create an execution error for statement failure.
|
|
220
276
|
|
|
221
277
|
#### Parameters[](#parameters-2 "Direct link to Parameters")
|
|
222
278
|
|
|
223
|
-
| Parameter
|
|
224
|
-
|
|
|
225
|
-
| `errorMessage?`
|
|
279
|
+
| Parameter | Type | Description |
|
|
280
|
+
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
281
|
+
| `errorMessage?` | `string` | Human-readable error from the warehouse / SDK. Goes into `.message` for server logs only — *never* echoed to the client. Pass `clientMessage` explicitly if a sanitized text should reach the UI. |
|
|
282
|
+
| `errorCode?` | `string` | Structured code (e.g. "INVALID\_PARAMETER\_VALUE") to preserve through wrapping. Optional. Forwarded on SSE error payloads so UI can branch on it instead of substring-matching `error`. |
|
|
283
|
+
| `clientMessage?` | `string` | Optional client-safe replacement for `.message`. Defaults to "Query execution failed" via the `clientMessage` getter. Set this only when the upstream text is known-safe. |
|
|
226
284
|
|
|
227
|
-
#### Returns[](#returns-
|
|
285
|
+
#### Returns[](#returns-7 "Direct link to Returns")
|
|
228
286
|
|
|
229
287
|
`ExecutionError`
|
|
230
288
|
|
|
@@ -245,6 +303,6 @@ Create an execution error for unknown state
|
|
|
245
303
|
| --------- | -------- |
|
|
246
304
|
| `state` | `string` |
|
|
247
305
|
|
|
248
|
-
#### Returns[](#returns-
|
|
306
|
+
#### Returns[](#returns-8 "Direct link to Returns")
|
|
249
307
|
|
|
250
308
|
`ExecutionError`
|