@lunora/errors 1.0.0-alpha.51 → 1.0.0-alpha.52

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 CHANGED
@@ -1187,6 +1187,13 @@ interface LunoraErrorOptions {
1187
1187
  */
1188
1188
  type LunoraErrorCodeInput = LunoraErrorCode | (string & {});
1189
1189
  declare class LunoraError extends Error {
1190
+ /**
1191
+ * `instanceof LunoraError` checks the cross-copy brand instead of the prototype
1192
+ * chain, so an error thrown by a duplicate copy of this package still matches.
1193
+ * Subclasses inherit this method; for them it falls back to the default
1194
+ * prototype check, so `x instanceof ConflictError` keeps meaning subclass membership.
1195
+ */
1196
+ static override [Symbol.hasInstance](value: unknown): boolean;
1190
1197
  /**
1191
1198
  * Discriminator recognised by `@visulima/error`'s `renderError`/`isVisulimaError`
1192
1199
  * (`error.type === "VisulimaError"`), so a `LunoraError` renders like a native
package/dist/index.d.ts CHANGED
@@ -1187,6 +1187,13 @@ interface LunoraErrorOptions {
1187
1187
  */
1188
1188
  type LunoraErrorCodeInput = LunoraErrorCode | (string & {});
1189
1189
  declare class LunoraError extends Error {
1190
+ /**
1191
+ * `instanceof LunoraError` checks the cross-copy brand instead of the prototype
1192
+ * chain, so an error thrown by a duplicate copy of this package still matches.
1193
+ * Subclasses inherit this method; for them it falls back to the default
1194
+ * prototype check, so `x instanceof ConflictError` keeps meaning subclass membership.
1195
+ */
1196
+ static override [Symbol.hasInstance](value: unknown): boolean;
1190
1197
  /**
1191
1198
  * Discriminator recognised by `@visulima/error`'s `renderError`/`isVisulimaError`
1192
1199
  * (`error.type === "VisulimaError"`), so a `LunoraError` renders like a native
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{LunoraError as t}from"./packem_shared/LunoraError-BeiVBT2t.mjs";import{CLOUDFLARE_PLATFORM_ERRORS as n,ERROR_CATALOG as a,MESSAGE_SOLUTIONS as i,findCloudflarePlatformSolution as f,findIssueSolution as l,findSolutionByMessage as E,flattenHint as s,getCatalogEntry as u,isInternalCode as R,resolveHint as S}from"./packem_shared/CLOUDFLARE_PLATFORM_ERRORS-Dx3-7SgW.mjs";import{isLunoraError as O}from"./packem_shared/isLunoraError-kpNg-Mxd.mjs";import{invariant as m,raise as p,unreachable as x}from"./packem_shared/invariant-CBWyEXW5.mjs";import{toErrorBody as C}from"./packem_shared/toErrorBody-DPXtaR0P.mjs";export{n as CLOUDFLARE_PLATFORM_ERRORS,a as ERROR_CATALOG,t as LunoraError,i as MESSAGE_SOLUTIONS,f as findCloudflarePlatformSolution,l as findIssueSolution,E as findSolutionByMessage,s as flattenHint,u as getCatalogEntry,m as invariant,R as isInternalCode,O as isLunoraError,p as raise,S as resolveHint,C as toErrorBody,x as unreachable};
1
+ import{LunoraError as t}from"./packem_shared/LunoraError-Bv_QazC4.mjs";import{CLOUDFLARE_PLATFORM_ERRORS as n,ERROR_CATALOG as a,MESSAGE_SOLUTIONS as i,findCloudflarePlatformSolution as f,findIssueSolution as l,findSolutionByMessage as E,flattenHint as s,getCatalogEntry as u,isInternalCode as R,resolveHint as S}from"./packem_shared/CLOUDFLARE_PLATFORM_ERRORS-Dx3-7SgW.mjs";import{isLunoraError as O}from"./packem_shared/isLunoraError-kpNg-Mxd.mjs";import{invariant as m,raise as p,unreachable as x}from"./packem_shared/invariant-C4M-b6AF.mjs";import{toErrorBody as C}from"./packem_shared/toErrorBody-DPXtaR0P.mjs";export{n as CLOUDFLARE_PLATFORM_ERRORS,a as ERROR_CATALOG,t as LunoraError,i as MESSAGE_SOLUTIONS,f as findCloudflarePlatformSolution,l as findIssueSolution,E as findSolutionByMessage,s as flattenHint,u as getCatalogEntry,m as invariant,R as isInternalCode,O as isLunoraError,p as raise,S as resolveHint,C as toErrorBody,x as unreachable};
@@ -0,0 +1 @@
1
+ import{getCatalogEntry as i}from"./CLOUDFLARE_PLATFORM_ERRORS-Dx3-7SgW.mjs";const e=Symbol.for("@lunora/errors/LunoraError");class a extends Error{static[Symbol.hasInstance](r){return this!==a?Function.prototype[Symbol.hasInstance].call(this,r):typeof r=="object"&&r!==null&&r[e]===!0}type="VisulimaError";hint;title;loc;code;status;docsUrl;data;constructor(r,c,t={}){const s=i(r);super(c??r,t.cause===void 0?void 0:{cause:t.cause}),this.name=t.name??"LunoraError",this.hint=t.hint??s?.hint,this.title=t.title??s?.title,this.loc=t.location,this.code=r,this.status=t.status??s?.status??500,this.docsUrl=t.docsUrl??s?.docsUrl,this.data=t.data,Object.defineProperty(this,e,{value:!0})}}export{a as LunoraError};
@@ -1 +1 @@
1
- import{LunoraError as o}from"./LunoraError-BeiVBT2t.mjs";const e=(r,n)=>{if(!r)throw new o("INTERNAL",n,{name:"InvariantError"})},i=r=>{throw new o("INTERNAL",r,{name:"InvariantError"})},w=(r,n,a)=>{throw new o(r,n,a)};export{e as invariant,w as raise,i as unreachable};
1
+ import{LunoraError as o}from"./LunoraError-Bv_QazC4.mjs";const e=(r,n)=>{if(!r)throw new o("INTERNAL",n,{name:"InvariantError"})},i=r=>{throw new o("INTERNAL",r,{name:"InvariantError"})},w=(r,n,a)=>{throw new o(r,n,a)};export{e as invariant,w as raise,i as unreachable};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/errors",
3
- "version": "1.0.0-alpha.51",
3
+ "version": "1.0.0-alpha.52",
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",
@@ -1 +0,0 @@
1
- import{getCatalogEntry as e}from"./CLOUDFLARE_PLATFORM_ERRORS-Dx3-7SgW.mjs";class l extends Error{type="VisulimaError";hint;title;loc;code;status;docsUrl;data;constructor(a,s,t={}){const r=e(a);super(s??a,t.cause===void 0?void 0:{cause:t.cause}),this.name=t.name??"LunoraError",this.hint=t.hint??r?.hint,this.title=t.title??r?.title,this.loc=t.location,this.code=a,this.status=t.status??r?.status??500,this.docsUrl=t.docsUrl??r?.docsUrl,this.data=t.data}}export{l as LunoraError};