@metaplex-foundation/kinobi 0.16.10 → 0.16.11
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/cjs/renderers/js-experimental/fragments/instructionType.njk +0 -1
- package/dist/cjs/renderers/js-experimental/fragments/programErrors.njk +4 -3
- package/dist/cjs/renderers/js-experimental/templates/globalTypesPage.njk +2 -0
- package/package.json +1 -1
- package/src/renderers/js-experimental/fragments/instructionType.njk +0 -1
- package/src/renderers/js-experimental/fragments/programErrors.njk +4 -3
- package/src/renderers/js-experimental/templates/globalTypesPage.njk +2 -0
|
@@ -9,12 +9,13 @@ export const enum {{ programErrorName }}Code {
|
|
|
9
9
|
|
|
10
10
|
export class {{ programErrorName }} extends Error {
|
|
11
11
|
override readonly name = '{{ programErrorName }}';
|
|
12
|
+
|
|
12
13
|
readonly code: {{ programErrorName }}Code;
|
|
14
|
+
|
|
13
15
|
readonly cause: Error | undefined;
|
|
14
16
|
|
|
15
17
|
constructor(code: {{ programErrorName }}Code, name: string, message: string, cause?: Error) {
|
|
16
18
|
super(`${name} (${code}): ${message}`);
|
|
17
|
-
Error.captureStackTrace(this, this.constructor);
|
|
18
19
|
this.code = code;
|
|
19
20
|
this.cause = cause;
|
|
20
21
|
}
|
|
@@ -32,7 +33,7 @@ if (__DEV__) {
|
|
|
32
33
|
export function get{{ programErrorName }}FromCode(code: {{ programErrorName }}Code, cause?: Error): {{ programErrorName }} {
|
|
33
34
|
if (__DEV__) {
|
|
34
35
|
return new {{ programErrorName }}(code, ...({{ programErrorName | camelCase }}CodeMap as Record<{{ programErrorName }}Code, [string, string]>)[code], cause);
|
|
35
|
-
} else {
|
|
36
|
-
return new {{ programErrorName }}(code, 'Unknown', 'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.', cause);
|
|
37
36
|
}
|
|
37
|
+
|
|
38
|
+
return new {{ programErrorName }}(code, 'Unknown', 'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.', cause);
|
|
38
39
|
}
|
package/package.json
CHANGED
|
@@ -9,12 +9,13 @@ export const enum {{ programErrorName }}Code {
|
|
|
9
9
|
|
|
10
10
|
export class {{ programErrorName }} extends Error {
|
|
11
11
|
override readonly name = '{{ programErrorName }}';
|
|
12
|
+
|
|
12
13
|
readonly code: {{ programErrorName }}Code;
|
|
14
|
+
|
|
13
15
|
readonly cause: Error | undefined;
|
|
14
16
|
|
|
15
17
|
constructor(code: {{ programErrorName }}Code, name: string, message: string, cause?: Error) {
|
|
16
18
|
super(`${name} (${code}): ${message}`);
|
|
17
|
-
Error.captureStackTrace(this, this.constructor);
|
|
18
19
|
this.code = code;
|
|
19
20
|
this.cause = cause;
|
|
20
21
|
}
|
|
@@ -32,7 +33,7 @@ if (__DEV__) {
|
|
|
32
33
|
export function get{{ programErrorName }}FromCode(code: {{ programErrorName }}Code, cause?: Error): {{ programErrorName }} {
|
|
33
34
|
if (__DEV__) {
|
|
34
35
|
return new {{ programErrorName }}(code, ...({{ programErrorName | camelCase }}CodeMap as Record<{{ programErrorName }}Code, [string, string]>)[code], cause);
|
|
35
|
-
} else {
|
|
36
|
-
return new {{ programErrorName }}(code, 'Unknown', 'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.', cause);
|
|
37
36
|
}
|
|
37
|
+
|
|
38
|
+
return new {{ programErrorName }}(code, 'Unknown', 'Error message not available in production bundles. Compile with __DEV__ set to true to see more information.', cause);
|
|
38
39
|
}
|