@databricks/appkit-ui 0.44.0 → 0.45.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.
Files changed (32) hide show
  1. package/dist/js/arrow/arrow-client.d.ts +8 -1
  2. package/dist/js/arrow/arrow-client.d.ts.map +1 -1
  3. package/dist/js/arrow/arrow-client.js +21 -2
  4. package/dist/js/arrow/arrow-client.js.map +1 -1
  5. package/dist/js/sse/connect-sse.js +1 -1
  6. package/dist/js/sse/connect-sse.js.map +1 -1
  7. package/dist/react/charts/types.d.ts +11 -4
  8. package/dist/react/charts/types.d.ts.map +1 -1
  9. package/dist/react/charts/types.js.map +1 -1
  10. package/dist/react/hooks/types.d.ts +10 -2
  11. package/dist/react/hooks/types.d.ts.map +1 -1
  12. package/dist/react/hooks/use-analytics-query.d.ts +5 -3
  13. package/dist/react/hooks/use-analytics-query.d.ts.map +1 -1
  14. package/dist/react/hooks/use-analytics-query.js +114 -33
  15. package/dist/react/hooks/use-analytics-query.js.map +1 -1
  16. package/dist/react/hooks/use-chart-data.d.ts +3 -3
  17. package/dist/react/hooks/use-chart-data.d.ts.map +1 -1
  18. package/dist/react/hooks/use-chart-data.js +3 -3
  19. package/dist/react/hooks/use-chart-data.js.map +1 -1
  20. package/dist/shared/src/index.d.ts +1 -0
  21. package/dist/shared/src/sse/analytics.d.ts +1 -0
  22. package/docs/api/appkit/Class.AppKitError.md +40 -8
  23. package/docs/api/appkit/Class.AuthenticationError.md +56 -16
  24. package/docs/api/appkit/Class.ConfigurationError.md +57 -17
  25. package/docs/api/appkit/Class.ConnectionError.md +57 -17
  26. package/docs/api/appkit/Class.ExecutionError.md +80 -22
  27. package/docs/api/appkit/Class.InitializationError.md +55 -15
  28. package/docs/api/appkit/Class.ServerError.md +55 -15
  29. package/docs/api/appkit/Class.TunnelError.md +56 -16
  30. package/docs/api/appkit/Class.ValidationError.md +55 -15
  31. package/package.json +1 -1
  32. package/sbom.cdx.json +1 -1
@@ -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 | Type |
32
- | ------------------ | ----------------------------------------------------------------- |
33
- | `message` | `string` |
34
- | `options?` | { `cause?`: `Error`; `context?`: `Record`<`string`, `unknown`>; } |
35
- | `options.cause?` | `Error` |
36
- | `options.context?` | `Record`<`string`, `unknown`> |
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-1 "Direct link to 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-2 "Direct link to 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-1 "Direct link to Returns")
172
+ #### Returns[​](#returns-2 "Direct link to Returns")
133
173
 
134
174
  `Record`<`string`, `unknown`>
135
175
 
136
- #### Inherited from[​](#inherited-from-3 "Direct link to 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-2 "Direct link to Returns")
191
+ #### Returns[​](#returns-3 "Direct link to Returns")
152
192
 
153
193
  `string`
154
194
 
155
- #### Inherited from[​](#inherited-from-4 "Direct link to 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-3 "Direct link to 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-4 "Direct link to 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-5 "Direct link to 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-6 "Direct link to 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-7 "Direct link to 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 | Type |
32
- | ------------------ | ----------------------------------------------------------------- |
33
- | `message` | `string` |
34
- | `options?` | { `cause?`: `Error`; `context?`: `Record`<`string`, `unknown`>; } |
35
- | `options.cause?` | `Error` |
36
- | `options.context?` | `Record`<`string`, `unknown`> |
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
- #### Inherited from[​](#inherited-from "Direct link to Inherited from")
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-1 "Direct link to 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-2 "Direct link to 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-1 "Direct link to 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-2 "Direct link to 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-3 "Direct link to 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-4 "Direct link to 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-5 "Direct link to 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(errorMessage?: string): ExecutionError;
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 | Type |
224
- | --------------- | -------- |
225
- | `errorMessage?` | `string` |
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-6 "Direct link to 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-7 "Direct link to Returns")
306
+ #### Returns[​](#returns-8 "Direct link to Returns")
249
307
 
250
308
  `ExecutionError`
@@ -21,6 +21,7 @@ throw new InitializationError("ServiceContext not initialized. Call ServiceConte
21
21
  ```ts
22
22
  new InitializationError(message: string, options?: {
23
23
  cause?: Error;
24
+ clientMessage?: string;
24
25
  context?: Record<string, unknown>;
25
26
  }): InitializationError;
26
27
 
@@ -28,12 +29,13 @@ new InitializationError(message: string, options?: {
28
29
 
29
30
  #### Parameters[​](#parameters "Direct link to Parameters")
30
31
 
31
- | Parameter | Type |
32
- | ------------------ | ----------------------------------------------------------------- |
33
- | `message` | `string` |
34
- | `options?` | { `cause?`: `Error`; `context?`: `Record`<`string`, `unknown`>; } |
35
- | `options.cause?` | `Error` |
36
- | `options.context?` | `Record`<`string`, `unknown`> |
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 InitializationError(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-1 "Direct link to 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-2 "Direct link to 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-1 "Direct link to Returns")
172
+ #### Returns[​](#returns-2 "Direct link to Returns")
133
173
 
134
174
  `Record`<`string`, `unknown`>
135
175
 
136
- #### Inherited from[​](#inherited-from-3 "Direct link to 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-2 "Direct link to Returns")
191
+ #### Returns[​](#returns-3 "Direct link to Returns")
152
192
 
153
193
  `string`
154
194
 
155
- #### Inherited from[​](#inherited-from-4 "Direct link to 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
 
@@ -173,7 +213,7 @@ Create an initialization error for migration failure
173
213
  | --------- | ------- |
174
214
  | `cause?` | `Error` |
175
215
 
176
- #### Returns[​](#returns-3 "Direct link to Returns")
216
+ #### Returns[​](#returns-4 "Direct link to Returns")
177
217
 
178
218
  `InitializationError`
179
219
 
@@ -195,7 +235,7 @@ Create an initialization error for a service that is not ready
195
235
  | `serviceName` | `string` |
196
236
  | `hint?` | `string` |
197
237
 
198
- #### Returns[​](#returns-4 "Direct link to Returns")
238
+ #### Returns[​](#returns-5 "Direct link to Returns")
199
239
 
200
240
  `InitializationError`
201
241
 
@@ -217,6 +257,6 @@ Create an initialization error for setup failure
217
257
  | `component` | `string` |
218
258
  | `cause?` | `Error` |
219
259
 
220
- #### Returns[​](#returns-5 "Direct link to Returns")
260
+ #### Returns[​](#returns-6 "Direct link to Returns")
221
261
 
222
262
  `InitializationError`
@@ -20,6 +20,7 @@ throw new ServerError("Server not started");
20
20
  ```ts
21
21
  new ServerError(message: string, options?: {
22
22
  cause?: Error;
23
+ clientMessage?: string;
23
24
  context?: Record<string, unknown>;
24
25
  }): ServerError;
25
26
 
@@ -27,12 +28,13 @@ new ServerError(message: string, options?: {
27
28
 
28
29
  #### Parameters[​](#parameters "Direct link to Parameters")
29
30
 
30
- | Parameter | Type |
31
- | ------------------ | ----------------------------------------------------------------- |
32
- | `message` | `string` |
33
- | `options?` | { `cause?`: `Error`; `context?`: `Record`<`string`, `unknown`>; } |
34
- | `options.cause?` | `Error` |
35
- | `options.context?` | `Record`<`string`, `unknown`> |
31
+ | Parameter | Type |
32
+ | ------------------------ | --------------------------------------------------------------------------------------------- |
33
+ | `message` | `string` |
34
+ | `options?` | { `cause?`: `Error`; `clientMessage?`: `string`; `context?`: `Record`<`string`, `unknown`>; } |
35
+ | `options.cause?` | `Error` |
36
+ | `options.clientMessage?` | `string` |
37
+ | `options.context?` | `Record`<`string`, `unknown`> |
36
38
 
37
39
  #### Returns[​](#returns "Direct link to Returns")
38
40
 
@@ -44,6 +46,23 @@ new ServerError(message: string, options?: {
44
46
 
45
47
  ## Properties[​](#properties "Direct link to Properties")
46
48
 
49
+ ### \_clientMessage?[​](#_clientmessage "Direct link to _clientMessage?")
50
+
51
+ ```ts
52
+ protected readonly optional _clientMessage: string;
53
+
54
+ ```
55
+
56
+ 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.
57
+
58
+ 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.
59
+
60
+ #### Inherited from[​](#inherited-from-1 "Direct link to Inherited from")
61
+
62
+ [`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`_clientMessage`](./docs/api/appkit/Class.AppKitError.md#_clientmessage)
63
+
64
+ ***
65
+
47
66
  ### cause?[​](#cause "Direct link to cause?")
48
67
 
49
68
  ```ts
@@ -53,7 +72,7 @@ readonly optional cause: Error;
53
72
 
54
73
  Optional cause of the error
55
74
 
56
- #### Inherited from[​](#inherited-from-1 "Direct link to Inherited from")
75
+ #### Inherited from[​](#inherited-from-2 "Direct link to Inherited from")
57
76
 
58
77
  [`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`cause`](./docs/api/appkit/Class.AppKitError.md#cause)
59
78
 
@@ -83,7 +102,7 @@ readonly optional context: Record<string, unknown>;
83
102
 
84
103
  Additional context for the error
85
104
 
86
- #### Inherited from[​](#inherited-from-2 "Direct link to Inherited from")
105
+ #### Inherited from[​](#inherited-from-3 "Direct link to Inherited from")
87
106
 
88
107
  [`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`context`](./docs/api/appkit/Class.AppKitError.md#context)
89
108
 
@@ -117,6 +136,27 @@ HTTP status code suggestion (can be overridden)
117
136
 
118
137
  [`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`statusCode`](./docs/api/appkit/Class.AppKitError.md#statuscode)
119
138
 
139
+ ## Accessors[​](#accessors "Direct link to Accessors")
140
+
141
+ ### clientMessage[​](#clientmessage "Direct link to clientMessage")
142
+
143
+ #### Get Signature[​](#get-signature "Direct link to Get Signature")
144
+
145
+ ```ts
146
+ get clientMessage(): string;
147
+
148
+ ```
149
+
150
+ Sanitized message safe to forward to clients. Override in subclasses if a more specific default is appropriate.
151
+
152
+ ##### Returns[​](#returns-1 "Direct link to Returns")
153
+
154
+ `string`
155
+
156
+ #### Inherited from[​](#inherited-from-4 "Direct link to Inherited from")
157
+
158
+ [`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`clientMessage`](./docs/api/appkit/Class.AppKitError.md#clientmessage)
159
+
120
160
  ## Methods[​](#methods "Direct link to Methods")
121
161
 
122
162
  ### toJSON()[​](#tojson "Direct link to toJSON()")
@@ -128,11 +168,11 @@ toJSON(): Record<string, unknown>;
128
168
 
129
169
  Convert error to JSON for logging/serialization. Sensitive values in context are automatically redacted.
130
170
 
131
- #### Returns[​](#returns-1 "Direct link to Returns")
171
+ #### Returns[​](#returns-2 "Direct link to Returns")
132
172
 
133
173
  `Record`<`string`, `unknown`>
134
174
 
135
- #### Inherited from[​](#inherited-from-3 "Direct link to Inherited from")
175
+ #### Inherited from[​](#inherited-from-5 "Direct link to Inherited from")
136
176
 
137
177
  [`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`toJSON`](./docs/api/appkit/Class.AppKitError.md#tojson)
138
178
 
@@ -147,11 +187,11 @@ toString(): string;
147
187
 
148
188
  Create a human-readable string representation
149
189
 
150
- #### Returns[​](#returns-2 "Direct link to Returns")
190
+ #### Returns[​](#returns-3 "Direct link to Returns")
151
191
 
152
192
  `string`
153
193
 
154
- #### Inherited from[​](#inherited-from-4 "Direct link to Inherited from")
194
+ #### Inherited from[​](#inherited-from-6 "Direct link to Inherited from")
155
195
 
156
196
  [`AppKitError`](./docs/api/appkit/Class.AppKitError.md).[`toString`](./docs/api/appkit/Class.AppKitError.md#tostring)
157
197
 
@@ -172,7 +212,7 @@ Create a server error for missing client directory
172
212
  | --------------- | ----------- |
173
213
  | `searchedPaths` | `string`\[] |
174
214
 
175
- #### Returns[​](#returns-3 "Direct link to Returns")
215
+ #### Returns[​](#returns-4 "Direct link to Returns")
176
216
 
177
217
  `ServerError`
178
218
 
@@ -187,7 +227,7 @@ static notStarted(): ServerError;
187
227
 
188
228
  Create a server error for server not started
189
229
 
190
- #### Returns[​](#returns-4 "Direct link to Returns")
230
+ #### Returns[​](#returns-5 "Direct link to Returns")
191
231
 
192
232
  `ServerError`
193
233
 
@@ -202,6 +242,6 @@ static viteNotInitialized(): ServerError;
202
242
 
203
243
  Create a server error for Vite dev server not initialized
204
244
 
205
- #### Returns[​](#returns-5 "Direct link to Returns")
245
+ #### Returns[​](#returns-6 "Direct link to Returns")
206
246
 
207
247
  `ServerError`