@lunora/errors 1.0.0-alpha.2 → 1.0.0-alpha.3
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/dist/index.d.mts +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.mjs +5 -5
- package/dist/packem_shared/{ERROR_CATALOG-DAg3Unhb.mjs → ERROR_CATALOG-CoCPcAHf.mjs} +4 -0
- package/dist/packem_shared/{LunoraError-Dg03M4uC.mjs → LunoraError-CwQSmeL3.mjs} +1 -1
- package/dist/packem_shared/{invariant-BsrkuTaN.mjs → invariant-DawIQfjN.mjs} +1 -1
- package/dist/packem_shared/{isLunoraError-BvsoKcWE.mjs → isLunoraError-CSQtYMrF.mjs} +1 -1
- package/dist/packem_shared/{toErrorBody-BbR2r6pO.mjs → toErrorBody-CyqyVwGF.mjs} +2 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -125,6 +125,23 @@ declare const ERROR_CATALOG: {
|
|
|
125
125
|
readonly status: 403;
|
|
126
126
|
readonly title: "RLS policy required";
|
|
127
127
|
};
|
|
128
|
+
readonly RUN_DEPTH_EXCEEDED: {
|
|
129
|
+
readonly internal: true;
|
|
130
|
+
readonly status: 500;
|
|
131
|
+
readonly title: "Run depth exceeded";
|
|
132
|
+
};
|
|
133
|
+
readonly MIGRATION_NOT_FOUND: {
|
|
134
|
+
readonly status: 404;
|
|
135
|
+
readonly title: "Data migration not found";
|
|
136
|
+
};
|
|
137
|
+
readonly UNKNOWN_TABLE: {
|
|
138
|
+
readonly status: 404;
|
|
139
|
+
readonly title: "Unknown table";
|
|
140
|
+
};
|
|
141
|
+
readonly GLOBAL_TABLE_NOT_EDITABLE: {
|
|
142
|
+
readonly status: 400;
|
|
143
|
+
readonly title: "Global table is not editable";
|
|
144
|
+
};
|
|
128
145
|
readonly SHARD_ERROR: {
|
|
129
146
|
readonly status: 503;
|
|
130
147
|
readonly title: "Shard error";
|
|
@@ -295,8 +312,15 @@ interface LunoraErrorLike extends Error {
|
|
|
295
312
|
docsUrl?: string;
|
|
296
313
|
hint?: ErrorHint;
|
|
297
314
|
status: number;
|
|
315
|
+
/** Wire brand that distinguishes real `LunoraError`s from foreign errors. */
|
|
316
|
+
type: "VisulimaError";
|
|
298
317
|
}
|
|
299
|
-
/**
|
|
318
|
+
/**
|
|
319
|
+
* True when `error` carries the Lunora transport shape (string `code` + numeric
|
|
320
|
+
* `status` + the `VisulimaError` brand). The `type` brand is what distinguishes
|
|
321
|
+
* a real `LunoraError` (or its wire-decoded twin) from a foreign error that
|
|
322
|
+
* happens to carry `code`/`status` — see plan 119 for the full rationale.
|
|
323
|
+
*/
|
|
300
324
|
declare const isLunoraError: (error: unknown) => error is LunoraErrorLike;
|
|
301
325
|
/** Throw an `INTERNAL` {@link LunoraError} when `condition` is falsy. */
|
|
302
326
|
declare const invariant: (condition: unknown, message: string) => asserts condition;
|
package/dist/index.d.ts
CHANGED
|
@@ -125,6 +125,23 @@ declare const ERROR_CATALOG: {
|
|
|
125
125
|
readonly status: 403;
|
|
126
126
|
readonly title: "RLS policy required";
|
|
127
127
|
};
|
|
128
|
+
readonly RUN_DEPTH_EXCEEDED: {
|
|
129
|
+
readonly internal: true;
|
|
130
|
+
readonly status: 500;
|
|
131
|
+
readonly title: "Run depth exceeded";
|
|
132
|
+
};
|
|
133
|
+
readonly MIGRATION_NOT_FOUND: {
|
|
134
|
+
readonly status: 404;
|
|
135
|
+
readonly title: "Data migration not found";
|
|
136
|
+
};
|
|
137
|
+
readonly UNKNOWN_TABLE: {
|
|
138
|
+
readonly status: 404;
|
|
139
|
+
readonly title: "Unknown table";
|
|
140
|
+
};
|
|
141
|
+
readonly GLOBAL_TABLE_NOT_EDITABLE: {
|
|
142
|
+
readonly status: 400;
|
|
143
|
+
readonly title: "Global table is not editable";
|
|
144
|
+
};
|
|
128
145
|
readonly SHARD_ERROR: {
|
|
129
146
|
readonly status: 503;
|
|
130
147
|
readonly title: "Shard error";
|
|
@@ -295,8 +312,15 @@ interface LunoraErrorLike extends Error {
|
|
|
295
312
|
docsUrl?: string;
|
|
296
313
|
hint?: ErrorHint;
|
|
297
314
|
status: number;
|
|
315
|
+
/** Wire brand that distinguishes real `LunoraError`s from foreign errors. */
|
|
316
|
+
type: "VisulimaError";
|
|
298
317
|
}
|
|
299
|
-
/**
|
|
318
|
+
/**
|
|
319
|
+
* True when `error` carries the Lunora transport shape (string `code` + numeric
|
|
320
|
+
* `status` + the `VisulimaError` brand). The `type` brand is what distinguishes
|
|
321
|
+
* a real `LunoraError` (or its wire-decoded twin) from a foreign error that
|
|
322
|
+
* happens to carry `code`/`status` — see plan 119 for the full rationale.
|
|
323
|
+
*/
|
|
300
324
|
declare const isLunoraError: (error: unknown) => error is LunoraErrorLike;
|
|
301
325
|
/** Throw an `INTERNAL` {@link LunoraError} when `condition` is falsy. */
|
|
302
326
|
declare const invariant: (condition: unknown, message: string) => asserts condition;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { LunoraError } from './packem_shared/LunoraError-
|
|
2
|
-
export { ERROR_CATALOG, MESSAGE_SOLUTIONS, findSolutionByMessage, flattenHint, isInternalCode, resolveHint } from './packem_shared/ERROR_CATALOG-
|
|
3
|
-
export { isLunoraError } from './packem_shared/isLunoraError-
|
|
4
|
-
export { invariant, unreachable } from './packem_shared/invariant-
|
|
5
|
-
export { toErrorBody } from './packem_shared/toErrorBody-
|
|
1
|
+
export { LunoraError } from './packem_shared/LunoraError-CwQSmeL3.mjs';
|
|
2
|
+
export { ERROR_CATALOG, MESSAGE_SOLUTIONS, findSolutionByMessage, flattenHint, isInternalCode, resolveHint } from './packem_shared/ERROR_CATALOG-CoCPcAHf.mjs';
|
|
3
|
+
export { isLunoraError } from './packem_shared/isLunoraError-CSQtYMrF.mjs';
|
|
4
|
+
export { invariant, unreachable } from './packem_shared/invariant-DawIQfjN.mjs';
|
|
5
|
+
export { toErrorBody } from './packem_shared/toErrorBody-CyqyVwGF.mjs';
|
|
@@ -48,6 +48,10 @@ const ERROR_CATALOG = {
|
|
|
48
48
|
status: 403,
|
|
49
49
|
title: "RLS policy required"
|
|
50
50
|
},
|
|
51
|
+
RUN_DEPTH_EXCEEDED: { internal: true, status: 500, title: "Run depth exceeded" },
|
|
52
|
+
MIGRATION_NOT_FOUND: { status: 404, title: "Data migration not found" },
|
|
53
|
+
UNKNOWN_TABLE: { status: 404, title: "Unknown table" },
|
|
54
|
+
GLOBAL_TABLE_NOT_EDITABLE: { status: 400, title: "Global table is not editable" },
|
|
51
55
|
SHARD_ERROR: { status: 503, title: "Shard error" },
|
|
52
56
|
SHARD_UNAVAILABLE: { status: 503, title: "Shard unavailable" },
|
|
53
57
|
OFFLINE_IDENTITY_CHANGED: { status: 409, title: "Offline identity changed" },
|
|
@@ -3,7 +3,7 @@ const isLunoraError = (error) => {
|
|
|
3
3
|
return false;
|
|
4
4
|
}
|
|
5
5
|
const candidate = error;
|
|
6
|
-
return typeof candidate.code === "string" && typeof candidate.status === "number";
|
|
6
|
+
return candidate.type === "VisulimaError" && typeof candidate.code === "string" && typeof candidate.status === "number";
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { isLunoraError };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isInternalCode, resolveHint } from './ERROR_CATALOG-
|
|
2
|
-
import { isLunoraError } from './isLunoraError-
|
|
1
|
+
import { isInternalCode, resolveHint } from './ERROR_CATALOG-CoCPcAHf.mjs';
|
|
2
|
+
import { isLunoraError } from './isLunoraError-CSQtYMrF.mjs';
|
|
3
3
|
|
|
4
4
|
const toErrorBody = (error, options = {}) => {
|
|
5
5
|
const redactedMessage = options.redactedMessage ?? "Internal error";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/errors",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.3",
|
|
4
4
|
"description": "Unified error layer for Lunora: one LunoraError base + a central catalog of codes, statuses, and actionable hints, rendered across CLI, overlay, Studio, and the client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|