@astrale-os/sdk 0.6.0-beta.48 → 0.6.0-beta.49

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.
@@ -1,4 +1,5 @@
1
1
  import * as errors from '@astrale-os/kernel-protocol/errors';
2
+ import { QueryError } from '../../../application/query/execution/error.js';
2
3
  import { ClientError, MissError, ProtocolError as ClientProtocolError, ResponseError, SessionError, StaleRouteError, TransportError, } from '../../../platform/client/index.js';
3
4
  const PUBLIC_DIAGNOSTICS = new Set(['VALUE_SCHEMA_INSTANCE_INVALID', 'VS_NUMBER_DOMAIN']);
4
5
  const PUBLIC_ERROR_CODES = new Set(Object.values(errors.CODES));
@@ -48,6 +49,10 @@ export function projectError(input) {
48
49
  ? input
49
50
  : protocolError('INTERNAL_ERROR', 'Internal application error.');
50
51
  }
52
+ // A v7 read the Kernel refused reaches the caller as that refusal, as a V6 read's did.
53
+ if (input instanceof QueryError && input.cause instanceof ResponseError) {
54
+ return projectError(input.cause);
55
+ }
51
56
  if (input instanceof ResponseError) {
52
57
  if (!PUBLIC_ERROR_CODES.has(input.code)) {
53
58
  return protocolError('BACKEND_UNAVAILABLE', 'Dependency Kernel returned invalid error evidence.');
package/docs/queries.md CHANGED
@@ -285,6 +285,14 @@ of that code:
285
285
 
286
286
  `isQueryError(error, code?)` recognizes one.
287
287
 
288
+ A `QueryError` an Action or an inline Workflow does not catch reaches its caller as follows:
289
+
290
+ - One the Kernel refused (`REFUSED`, `OUTDATED`, `UNSUPPORTED` for `v7`, `INPUT_INVALID` with a
291
+ `kernelCode`, `TOO_MANY` past the Host's bytes) reaches it as that refusal: the Kernel's public
292
+ code, message and data. A Kernel code outside the public codes reaches it as
293
+ `BACKEND_UNAVAILABLE`.
294
+ - One the SDK raised itself, the client's bytes included, reaches it as an internal error.
295
+
288
296
  A refusal the caller handles by code is declared in `errors`, as on Actions, and raised by
289
297
  `output`:
290
298
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrale-os/sdk",
3
- "version": "0.6.0-beta.48",
3
+ "version": "0.6.0-beta.49",
4
4
  "description": "Schema-first SDK for defining, composing, and deploying Astrale domains",
5
5
  "keywords": [
6
6
  "astrale",