@layerzerolabs/common-error-utils 1.2.46 → 1.2.47
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.
|
@@ -132,7 +132,7 @@ var NonRetryableError = class extends SerializableError {
|
|
|
132
132
|
super(message, options);
|
|
133
133
|
}
|
|
134
134
|
};
|
|
135
|
-
var AssertionError = class extends
|
|
135
|
+
var AssertionError = class extends SerializableError {
|
|
136
136
|
static {
|
|
137
137
|
__name(this, "AssertionError");
|
|
138
138
|
}
|
|
@@ -140,7 +140,7 @@ var AssertionError = class extends NonRetryableError {
|
|
|
140
140
|
super(message, options);
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
|
-
var ActivityNotAvailableError = class extends
|
|
143
|
+
var ActivityNotAvailableError = class extends SerializableError {
|
|
144
144
|
static {
|
|
145
145
|
__name(this, "ActivityNotAvailableError");
|
|
146
146
|
}
|
|
@@ -206,5 +206,5 @@ var assertUnreachable = /* @__PURE__ */ __name((value) => {
|
|
|
206
206
|
}, "assertUnreachable");
|
|
207
207
|
|
|
208
208
|
export { ActivityNotAvailableError, AssertionError, MultiError, NonEmittableError, NonRetryableError, NotFoundError, ProviderError, QuorumNotAchievedYet, SerializableError, assertUnreachable, convertErrorToObject, normalizeError, throwError };
|
|
209
|
-
//# sourceMappingURL=
|
|
210
|
-
//# sourceMappingURL=
|
|
209
|
+
//# sourceMappingURL=ZAAFJP3A.js.map
|
|
210
|
+
//# sourceMappingURL=ZAAFJP3A.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts"],"names":["extractMessageFromJsonRpcError","err","body","message","parsedBody","JSON","parse","error","convertErrorToObject","stringify","Object","getOwnPropertyNames","normalizeError","name","stack","reason","code","event","SerializableError","Error","details","cause","options","computeClassChain","instance","chain","proto","getPrototypeOf","prototype","push","inStackOf","includes","undefined","nonRetryable","args","NonRetryableError","wrap","wrappedError","combinedDetails","Set","originalMessage","String","AssertionError","ActivityNotAvailableError","NotFoundError","ProviderError","providerUri","parseHost","url","URL","host","NonEmittableError","QuorumNotAchievedYet","MultiError","errs","map","join","throwError","assertUnreachable","value"],"mappings":";;;AAAA,IAAMA,8BAAAA,2BAAkCC,GAAAA,KAAAA;AACpC,EAAA,IAAI;AACA,IAAA,IAAI,OAAOA,GAAAA,CAAIC,IAAAA,KAAS,QAAA,IAAYD,GAAAA,CAAIC,KAAKC,OAAAA,EAAS;AAClD,MAAA,OAAOF,IAAIC,IAAAA,CAAKC,OAAAA;AACpB,IAAA;AACA,IAAA,MAAMC,UAAAA,GAAaC,IAAAA,CAAKC,KAAAA,CAAML,GAAAA,CAAIC,IAAI,CAAA;AACtC,IAAA,OAAOE,YAAYG,KAAAA,EAAOJ,OAAAA;EAC9B,CAAA,CAAA,MAAQ;AACJ,IAAA,OAAO,SAAA;AACX,EAAA;AACJ,CAAA,EAVuC,gCAAA,CAAA;AAYhC,SAASK,qBAAqBP,GAAAA,EAAQ;AACzC,EAAA,OAAOI,IAAAA,CAAKC,MAAMD,IAAAA,CAAKI,SAAAA,CAAUR,KAAKS,MAAAA,CAAOC,mBAAAA,CAAoBV,GAAAA,CAAAA,CAAAA,CAAAA;AACrE;AAFgBO,MAAAA,CAAAA,oBAAAA,EAAAA,sBAAAA,CAAAA;AAIT,SAASI,eAAeX,GAAAA,EAAQ;AACnC,EAAA,MAAMM,KAAAA,GAAQC,qBAAqBP,GAAAA,CAAAA;AACnC,EAAA,OAAO;;AAEH,IAAA,GAAIM,MAAMM,IAAAA,GAAO;AAAEA,MAAAA,IAAAA,EAAMN,KAAAA,CAAMM;AAAK,KAAA,GAAI,EAAC;AACzC,IAAA,GAAIN,MAAMJ,OAAAA,GAAU;AAAEA,MAAAA,OAAAA,EAASI,KAAAA,CAAMJ;AAAQ,KAAA,GAAI,EAAC;AAClD,IAAA,GAAII,MAAMO,KAAAA,GAAQ;AAAEA,MAAAA,KAAAA,EAAOP,KAAAA,CAAMO;AAAM,KAAA,GAAI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;AAE5B,EAAA;AACJ;AAYO,IAAMG,UAAAA,mBAAa,MAAA,CAAA,CACtBtD,OAAAA,EACAI,KAAAA,KAAAA;AAEA,EAAA,MAAMA,KAAAA,GAAQJ,OAAAA,CAAAA,IAAY,IAAIgB,MAAMhB,OAAAA,CAAAA;AACxC,CAAA,EAL0B,YAAA;AAWnB,IAAMuD,iBAAAA,2BAAqBC,KAAAA,KAAAA;AAC9B,EAAA,MAAM,IAAIxB,iBAAAA,CAAkB,CAAA,mBAAA,EAAsBwB,KAAAA,CAAAA,CAAO,CAAA;AAC7D,CAAA,EAFiC,mBAAA","file":"SMWKOQQS.js","sourcesContent":["const extractMessageFromJsonRpcError = (err: any): string => {\n try {\n if (typeof err.body === 'object' && err.body.message) {\n return err.body.message;\n }\n const parsedBody = JSON.parse(err.body);\n return parsedBody?.error?.message;\n } catch {\n return 'unknown';\n }\n};\n\nexport function convertErrorToObject(err: any): any {\n return JSON.parse(JSON.stringify(err, Object.getOwnPropertyNames(err)));\n}\n\nexport function normalizeError(err: any) {\n const error = convertErrorToObject(err);\n return {\n // Normal Error properties\n ...(error.name ? { name: error.name } : {}),\n ...(error.message ? { message: error.message } : {}),\n ...(error.stack ? { stack: error.stack } : {}),\n // Rpc properties\n ...(error.reason ? { reason: error.reason } : {}),\n ...(error.code ? { code: error.code } : {}),\n ...(error.event ? { event: error.event } : {}),\n ...(error.body ? { body: extractMessageFromJsonRpcError(error) } : {}),\n };\n}\n\n// Removes the last argument if it is an ErrorOptions\ntype RemoveErrorOptions<T extends any[]> = T extends [...infer U, ErrorOptions?] ? U : never;\n\n/**\n * Base class for all serializable errors.\n * This class is designed to be extended by other error classes.\n * It provides a way to wrap errors and a way to check if an error is in the stack of a specific error class.\n * All errors that extend this class *must* have error options as the last argument in their constructor.\n */\nexport abstract class SerializableError extends Error {\n details: string[];\n /*\n * The instance of the error that was wrapped, if any.\n * Creates a linked list of error objects.\n * Only exists if the error hasn't been serialized and deserialized.\n */\n cause: unknown;\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n // for some reason, we need to set the cause directly on the instance, even after calling super\n this.cause = options?.cause;\n this.name = this.constructor.name;\n this.details = SerializableError.computeClassChain(this);\n }\n\n private static computeClassChain(instance: SerializableError): string[] {\n const chain: string[] = [];\n let proto: object | null = Object.getPrototypeOf(instance);\n while (proto && proto !== Error.prototype && proto !== Object.prototype) {\n const name = proto.constructor?.name;\n if (name) {\n chain.push(name);\n }\n if (name === SerializableError.name) {\n break;\n }\n proto = Object.getPrototypeOf(proto);\n }\n return chain;\n }\n\n /*\n * Checks if the error is an instance of the current class or a subclass. Returns the error if it is.\n * We can't type the error as more than SerializableError because it could have been serialized and deserialized,\n * which could make it lose extra fields.\n */\n static inStackOf<T extends abstract new (...args: any) => any>(\n this: T,\n error: any,\n ): SerializableError | undefined {\n if (error?.details?.includes(this.name)) {\n return error as SerializableError;\n } else if (error?.cause?.details?.includes(this.name)) {\n return error.cause as SerializableError;\n }\n return undefined;\n }\n\n /*\n * Constructs this error and marks it non-retryable, e.g. AssertionError.nonRetryable('...').\n * Being non-retryable is a modifier rather than a kind of error, so prefer this over extending\n * NonRetryableError. Retry policies match on the exact class name and not the prototype chain,\n * so a subclass is silently retried unless its own name is registered in every policy.\n * The result keeps this error's class chain in details, so inStackOf still narrows to it.\n */\n static nonRetryable<T extends new (...args: any) => SerializableError>(\n this: T,\n ...args: ConstructorParameters<T>\n ): NonRetryableError {\n const error = new this(...args);\n // exact match only, since a subclass of NonRetryableError still reports its own name\n if (error.constructor === NonRetryableError) {\n return error as NonRetryableError;\n }\n\n return NonRetryableError.wrap(error, '');\n }\n\n // We could limit this to only wrap serializable errors, but that could limit the flexibility of the error system.\n static wrap<T extends new (...args: any) => SerializableError>(\n this: T,\n error: any,\n // Remove the optional error arguments\n ...args: RemoveErrorOptions<ConstructorParameters<T>>\n ): InstanceType<T> {\n const wrappedError = new this(...args, { cause: error });\n\n const combinedDetails = error?.details\n ? [...wrappedError.details, ...error.details]\n : [...wrappedError.details, error?.name ?? 'UnknownError'];\n wrappedError.details = [...new Set(combinedDetails)];\n\n const originalMessage = error?.message ?? String(error);\n wrappedError.message = wrappedError.message\n ? `${wrappedError.message} > ${originalMessage}`\n : originalMessage;\n\n return wrappedError as InstanceType<T>;\n }\n}\n\nexport class NonRetryableError extends SerializableError {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n }\n}\n\n/** Thrown when an internal invariant is violated. */\nexport class AssertionError extends NonRetryableError {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n }\n}\n\n/**\n * Thrown when an activity method or chain capability is not available.\n * Extends NonRetryableError so activity registries treat the failure as non-retryable.\n * Prefer this over plain Error for unimplemented stubs and missing chain implementations.\n */\nexport class ActivityNotAvailableError extends NonRetryableError {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n }\n}\n\nexport class NotFoundError extends SerializableError {\n constructor(message?: string, options?: ErrorOptions) {\n super(message ? `Not found: ${message}` : 'Not found', options);\n }\n}\n\n// TODO: extend this for chain specific providers\nexport class ProviderError extends SerializableError {\n constructor(providerUri: string, options?: ErrorOptions) {\n super(`Provider error at host '${ProviderError.parseHost(providerUri)}'`, options);\n }\n\n private static parseHost(providerUri: string): string {\n try {\n const url = new URL(providerUri);\n return url.host;\n } catch {\n return 'UNKNOWN_HOST';\n }\n }\n}\n\nexport class NonEmittableError extends SerializableError {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = 'NonEmittableError';\n }\n}\n\nexport class QuorumNotAchievedYet extends SerializableError {\n constructor(options?: ErrorOptions) {\n super('The quorum was not achieved yet', options);\n }\n}\n\nexport class MultiError extends Error {\n constructor(public readonly errs: any[]) {\n super(errs.map((err) => err.message).join(', '));\n }\n}\n\n/**\n * Throw from an expression position (`??`, `||`, ternaries, `return`, etc.).\n *\n * Prefer a normal `throw new Error(...)` / `throw new SomeError(...)` in statement\n * position.\n *\n * @example\n * const value = maybe ?? throwError('missing value');\n * const value = maybe ?? throwError('missing value', (msg) => new NonRetryableError(msg));\n */\nexport const throwError = <Err extends Error>(\n message: string,\n error?: (message: string) => Err,\n): never => {\n throw error?.(message) ?? new Error(message);\n};\n\n/**\n * Assert that a value is never.\n * Most useful for enforcing exhaustive switch statements.\n */\nexport const assertUnreachable = (value: never): never => {\n throw new NonRetryableError(`Unreachable value: ${value}`);\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"names":["extractMessageFromJsonRpcError","err","body","message","parsedBody","JSON","parse","error","convertErrorToObject","stringify","Object","getOwnPropertyNames","normalizeError","name","stack","reason","code","event","SerializableError","Error","details","cause","options","computeClassChain","instance","chain","proto","getPrototypeOf","prototype","push","inStackOf","includes","undefined","nonRetryable","args","NonRetryableError","wrap","wrappedError","combinedDetails","Set","originalMessage","String","AssertionError","ActivityNotAvailableError","NotFoundError","ProviderError","providerUri","parseHost","url","URL","host","NonEmittableError","QuorumNotAchievedYet","MultiError","errs","map","join","throwError","assertUnreachable","value"],"mappings":";;;AAAA,IAAMA,8BAAAA,2BAAkCC,GAAAA,KAAAA;AACpC,EAAA,IAAI;AACA,IAAA,IAAI,OAAOA,GAAAA,CAAIC,IAAAA,KAAS,QAAA,IAAYD,GAAAA,CAAIC,KAAKC,OAAAA,EAAS;AAClD,MAAA,OAAOF,IAAIC,IAAAA,CAAKC,OAAAA;AACpB,IAAA;AACA,IAAA,MAAMC,UAAAA,GAAaC,IAAAA,CAAKC,KAAAA,CAAML,GAAAA,CAAIC,IAAI,CAAA;AACtC,IAAA,OAAOE,YAAYG,KAAAA,EAAOJ,OAAAA;EAC9B,CAAA,CAAA,MAAQ;AACJ,IAAA,OAAO,SAAA;AACX,EAAA;AACJ,CAAA,EAVuC,gCAAA,CAAA;AAYhC,SAASK,qBAAqBP,GAAAA,EAAQ;AACzC,EAAA,OAAOI,IAAAA,CAAKC,MAAMD,IAAAA,CAAKI,SAAAA,CAAUR,KAAKS,MAAAA,CAAOC,mBAAAA,CAAoBV,GAAAA,CAAAA,CAAAA,CA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,GAAO,mBAAA;AAChB,EAAA;AACJ;AAEO,IAAMuC,oBAAAA,GAAN,cAAmClC,iBAAAA,CAAAA;EA5L1C;;;AA6LI,EAAA,WAAA,CAAYI,OAAAA,EAAwB;AAChC,IAAA,KAAA,CAAM,mCAAmCA,OAAAA,CAAAA;AAC7C,EAAA;AACJ;AAEO,IAAM+B,UAAAA,GAAN,cAAyBlC,KAAAA,CAAAA;EAlMhC;;;;AAmMI,EAAA,WAAA,CAA4BmC,IAAAA,EAAa;AACrC,IAAA,KAAA,CAAMA,IAAAA,CAAKC,GAAAA,CAAI,CAACtD,GAAAA,KAAQA,GAAAA,CAAIE,OAAO,CAAA,CAAEqD,IAAAA,CAAK,IAAA,CAAA,CAAA,EAAA,IAAA,CADlBF,IAAAA,GAAAA,IAAAA;AAE5B,EAAA;AACJ;AAYO,IAAMG,UAAAA,mBAAa,MAAA,CAAA,CACtBtD,OAAAA,EACAI,KAAAA,KAAAA;AAEA,EAAA,MAAMA,KAAAA,GAAQJ,OAAAA,CAAAA,IAAY,IAAIgB,MAAMhB,OAAAA,CAAAA;AACxC,CAAA,EAL0B,YAAA;AAWnB,IAAMuD,iBAAAA,2BAAqBC,KAAAA,KAAAA;AAC9B,EAAA,MAAM,IAAIxB,iBAAAA,CAAkB,CAAA,mBAAA,EAAsBwB,KAAAA,CAAAA,CAAO,CAAA;AAC7D,CAAA,EAFiC,mBAAA","file":"ZAAFJP3A.js","sourcesContent":["const extractMessageFromJsonRpcError = (err: any): string => {\n try {\n if (typeof err.body === 'object' && err.body.message) {\n return err.body.message;\n }\n const parsedBody = JSON.parse(err.body);\n return parsedBody?.error?.message;\n } catch {\n return 'unknown';\n }\n};\n\nexport function convertErrorToObject(err: any): any {\n return JSON.parse(JSON.stringify(err, Object.getOwnPropertyNames(err)));\n}\n\nexport function normalizeError(err: any) {\n const error = convertErrorToObject(err);\n return {\n // Normal Error properties\n ...(error.name ? { name: error.name } : {}),\n ...(error.message ? { message: error.message } : {}),\n ...(error.stack ? { stack: error.stack } : {}),\n // Rpc properties\n ...(error.reason ? { reason: error.reason } : {}),\n ...(error.code ? { code: error.code } : {}),\n ...(error.event ? { event: error.event } : {}),\n ...(error.body ? { body: extractMessageFromJsonRpcError(error) } : {}),\n };\n}\n\n// Removes the last argument if it is an ErrorOptions\ntype RemoveErrorOptions<T extends any[]> = T extends [...infer U, ErrorOptions?] ? U : never;\n\n/**\n * Base class for all serializable errors.\n * This class is designed to be extended by other error classes.\n * It provides a way to wrap errors and a way to check if an error is in the stack of a specific error class.\n * All errors that extend this class *must* have error options as the last argument in their constructor.\n */\nexport abstract class SerializableError extends Error {\n details: string[];\n /*\n * The instance of the error that was wrapped, if any.\n * Creates a linked list of error objects.\n * Only exists if the error hasn't been serialized and deserialized.\n */\n cause: unknown;\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n // for some reason, we need to set the cause directly on the instance, even after calling super\n this.cause = options?.cause;\n this.name = this.constructor.name;\n this.details = SerializableError.computeClassChain(this);\n }\n\n private static computeClassChain(instance: SerializableError): string[] {\n const chain: string[] = [];\n let proto: object | null = Object.getPrototypeOf(instance);\n while (proto && proto !== Error.prototype && proto !== Object.prototype) {\n const name = proto.constructor?.name;\n if (name) {\n chain.push(name);\n }\n if (name === SerializableError.name) {\n break;\n }\n proto = Object.getPrototypeOf(proto);\n }\n return chain;\n }\n\n /*\n * Checks if the error is an instance of the current class or a subclass. Returns the error if it is.\n * We can't type the error as more than SerializableError because it could have been serialized and deserialized,\n * which could make it lose extra fields.\n */\n static inStackOf<T extends abstract new (...args: any) => any>(\n this: T,\n error: any,\n ): SerializableError | undefined {\n if (error?.details?.includes(this.name)) {\n return error as SerializableError;\n } else if (error?.cause?.details?.includes(this.name)) {\n return error.cause as SerializableError;\n }\n return undefined;\n }\n\n /*\n * Constructs this error and marks it non-retryable, e.g. AssertionError.nonRetryable('...').\n * Being non-retryable is a modifier rather than a kind of error, so prefer this over extending\n * NonRetryableError. Retry policies match on the exact class name and not the prototype chain,\n * so a subclass is silently retried unless its own name is registered in every policy.\n * The result keeps this error's class chain in details, so inStackOf still narrows to it.\n */\n static nonRetryable<T extends new (...args: any) => SerializableError>(\n this: T,\n ...args: ConstructorParameters<T>\n ): NonRetryableError {\n const error = new this(...args);\n // exact match only, since a subclass of NonRetryableError still reports its own name\n if (error.constructor === NonRetryableError) {\n return error as NonRetryableError;\n }\n\n return NonRetryableError.wrap(error, '');\n }\n\n // We could limit this to only wrap serializable errors, but that could limit the flexibility of the error system.\n static wrap<T extends new (...args: any) => SerializableError>(\n this: T,\n error: any,\n // Remove the optional error arguments\n ...args: RemoveErrorOptions<ConstructorParameters<T>>\n ): InstanceType<T> {\n const wrappedError = new this(...args, { cause: error });\n\n const combinedDetails = error?.details\n ? [...wrappedError.details, ...error.details]\n : [...wrappedError.details, error?.name ?? 'UnknownError'];\n wrappedError.details = [...new Set(combinedDetails)];\n\n const originalMessage = error?.message ?? String(error);\n wrappedError.message = wrappedError.message\n ? `${wrappedError.message} > ${originalMessage}`\n : originalMessage;\n\n return wrappedError as InstanceType<T>;\n }\n}\n\nexport class NonRetryableError extends SerializableError {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n }\n}\n\n/**\n * Thrown when an internal invariant is violated.\n * Throw it via AssertionError.nonRetryable(...); plain construction is retryable.\n */\nexport class AssertionError extends SerializableError {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n }\n}\n\n/**\n * Thrown when an activity method or chain capability is not available.\n * Prefer this over plain Error for unimplemented stubs and missing chain implementations.\n * Throw it via ActivityNotAvailableError.nonRetryable(...); plain construction is retryable.\n */\nexport class ActivityNotAvailableError extends SerializableError {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n }\n}\n\nexport class NotFoundError extends SerializableError {\n constructor(message?: string, options?: ErrorOptions) {\n super(message ? `Not found: ${message}` : 'Not found', options);\n }\n}\n\n// TODO: extend this for chain specific providers\nexport class ProviderError extends SerializableError {\n constructor(providerUri: string, options?: ErrorOptions) {\n super(`Provider error at host '${ProviderError.parseHost(providerUri)}'`, options);\n }\n\n private static parseHost(providerUri: string): string {\n try {\n const url = new URL(providerUri);\n return url.host;\n } catch {\n return 'UNKNOWN_HOST';\n }\n }\n}\n\nexport class NonEmittableError extends SerializableError {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = 'NonEmittableError';\n }\n}\n\nexport class QuorumNotAchievedYet extends SerializableError {\n constructor(options?: ErrorOptions) {\n super('The quorum was not achieved yet', options);\n }\n}\n\nexport class MultiError extends Error {\n constructor(public readonly errs: any[]) {\n super(errs.map((err) => err.message).join(', '));\n }\n}\n\n/**\n * Throw from an expression position (`??`, `||`, ternaries, `return`, etc.).\n *\n * Prefer a normal `throw new Error(...)` / `throw new SomeError(...)` in statement\n * position.\n *\n * @example\n * const value = maybe ?? throwError('missing value');\n * const value = maybe ?? throwError('missing value', (msg) => new NonRetryableError(msg));\n */\nexport const throwError = <Err extends Error>(\n message: string,\n error?: (message: string) => Err,\n): never => {\n throw error?.(message) ?? new Error(message);\n};\n\n/**\n * Assert that a value is never.\n * Most useful for enforcing exhaustive switch statements.\n */\nexport const assertUnreachable = (value: never): never => {\n throw new NonRetryableError(`Unreachable value: ${value}`);\n};\n"]}
|
package/dist/errors.d.ts
CHANGED
|
@@ -27,16 +27,19 @@ export declare abstract class SerializableError extends Error {
|
|
|
27
27
|
export declare class NonRetryableError extends SerializableError {
|
|
28
28
|
constructor(message: string, options?: ErrorOptions);
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Thrown when an internal invariant is violated.
|
|
32
|
+
* Throw it via AssertionError.nonRetryable(...); plain construction is retryable.
|
|
33
|
+
*/
|
|
34
|
+
export declare class AssertionError extends SerializableError {
|
|
32
35
|
constructor(message: string, options?: ErrorOptions);
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* Thrown when an activity method or chain capability is not available.
|
|
36
|
-
* Extends NonRetryableError so activity registries treat the failure as non-retryable.
|
|
37
39
|
* Prefer this over plain Error for unimplemented stubs and missing chain implementations.
|
|
40
|
+
* Throw it via ActivityNotAvailableError.nonRetryable(...); plain construction is retryable.
|
|
38
41
|
*/
|
|
39
|
-
export declare class ActivityNotAvailableError extends
|
|
42
|
+
export declare class ActivityNotAvailableError extends SerializableError {
|
|
40
43
|
constructor(message: string, options?: ErrorOptions);
|
|
41
44
|
}
|
|
42
45
|
export declare class NotFoundError extends SerializableError {
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAYA,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAElD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG;;;;;;;;EAatC;AAGD,KAAK,kBAAkB,CAAC,CAAC,SAAS,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE7F;;;;;GAKG;AACH,8BAAsB,iBAAkB,SAAQ,KAAK;IACjD,OAAO,EAAE,MAAM,EAAE,CAAC;IAMlB,KAAK,EAAE,OAAO,CAAC;gBACH,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;IAQnD,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAqBhC,MAAM,CAAC,SAAS,CAAC,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,EACzD,IAAI,EAAE,CAAC,EACP,KAAK,EAAE,GAAG,GACX,iBAAiB,GAAG,SAAS;IAgBhC,MAAM,CAAC,YAAY,CAAC,CAAC,SAAS,KAAK,GAAG,IAAI,EAAE,GAAG,KAAK,iBAAiB,EACjE,IAAI,EAAE,CAAC,EACP,GAAG,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAClC,iBA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AEF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK,KAAG,KAEhD,CAAC"}
|
package/dist/errors.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ActivityNotAvailableError, AssertionError, MultiError, NonEmittableError, NonRetryableError, NotFoundError, ProviderError, QuorumNotAchievedYet, SerializableError, assertUnreachable, convertErrorToObject, normalizeError, throwError } from './
|
|
1
|
+
export { ActivityNotAvailableError, AssertionError, MultiError, NonEmittableError, NonRetryableError, NotFoundError, ProviderError, QuorumNotAchievedYet, SerializableError, assertUnreachable, convertErrorToObject, normalizeError, throwError } from './ZAAFJP3A.js';
|
|
2
2
|
import './VUOMXK5T.js';
|
|
3
3
|
//# sourceMappingURL=errors.js.map
|
|
4
4
|
//# sourceMappingURL=errors.js.map
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ActivityNotAvailableError, AssertionError, MultiError, NonEmittableError, NonRetryableError, NotFoundError, ProviderError, QuorumNotAchievedYet, SerializableError, assertUnreachable, convertErrorToObject, normalizeError, throwError } from './
|
|
1
|
+
export { ActivityNotAvailableError, AssertionError, MultiError, NonEmittableError, NonRetryableError, NotFoundError, ProviderError, QuorumNotAchievedYet, SerializableError, assertUnreachable, convertErrorToObject, normalizeError, throwError } from './ZAAFJP3A.js';
|
|
2
2
|
export { runWithRetryPolicy } from './WUDCWRMR.js';
|
|
3
3
|
import './VUOMXK5T.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/common-error-utils",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.47",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"@types/ms": "^2.1.0",
|
|
24
24
|
"tsup": "^8.4.0",
|
|
25
25
|
"vitest": "^4.1.10",
|
|
26
|
-
"@layerzerolabs/tsup-configuration": "1.2.
|
|
27
|
-
"@layerzerolabs/typescript-configuration": "1.2.
|
|
26
|
+
"@layerzerolabs/tsup-configuration": "1.2.47",
|
|
27
|
+
"@layerzerolabs/typescript-configuration": "1.2.47"
|
|
28
28
|
},
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public",
|