@fuel-ts/errors
Advanced tools
Comparing version 0.90.0 to 0.91.0
@@ -73,7 +73,8 @@ /** | ||
VITEPRESS_PLUGIN_ERROR = "vitepress-plugin-error", | ||
INVALID_MULTICALL = "invalid-multicall", | ||
SCRIPT_REVERTED = "script-reverted", | ||
SCRIPT_RETURN_INVALID_TYPE = "script-return-invalid-type", | ||
STREAM_PARSING_ERROR = "stream-parsing-error" | ||
STREAM_PARSING_ERROR = "stream-parsing-error", | ||
NODE_LAUNCH_FAILED = "node-launch-failed", | ||
UNKNOWN = "unknown" | ||
} | ||
//# sourceMappingURL=error-codes.d.ts.map |
@@ -10,5 +10,6 @@ import { ErrorCode } from './error-codes'; | ||
readonly metadata: Record<string, unknown>; | ||
readonly rawError: unknown; | ||
static parse(e: unknown): FuelError; | ||
code: ErrorCode; | ||
constructor(code: ErrorCode, message: string, metadata?: Record<string, unknown>); | ||
constructor(code: ErrorCode, message: string, metadata?: Record<string, unknown>, rawError?: unknown); | ||
toObject(): { | ||
@@ -24,4 +25,5 @@ code: ErrorCode; | ||
}; | ||
rawError: unknown; | ||
}; | ||
} | ||
//# sourceMappingURL=fuel-error.d.ts.map |
@@ -80,6 +80,7 @@ "use strict"; | ||
ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error"; | ||
ErrorCode2["INVALID_MULTICALL"] = "invalid-multicall"; | ||
ErrorCode2["SCRIPT_REVERTED"] = "script-reverted"; | ||
ErrorCode2["SCRIPT_RETURN_INVALID_TYPE"] = "script-return-invalid-type"; | ||
ErrorCode2["STREAM_PARSING_ERROR"] = "stream-parsing-error"; | ||
ErrorCode2["NODE_LAUNCH_FAILED"] = "node-launch-failed"; | ||
ErrorCode2["UNKNOWN"] = "unknown"; | ||
return ErrorCode2; | ||
@@ -91,5 +92,5 @@ })(ErrorCode || {}); | ||
return { | ||
FORC: "0.60.0", | ||
FORC: "0.61.1", | ||
FUEL_CORE: "0.30.0", | ||
FUELS: "0.90.0" | ||
FUELS: "0.91.0" | ||
}; | ||
@@ -103,2 +104,3 @@ } | ||
metadata; | ||
rawError; | ||
static parse(e) { | ||
@@ -123,3 +125,3 @@ const error = e; | ||
code; | ||
constructor(code, message, metadata = {}) { | ||
constructor(code, message, metadata = {}, rawError = {}) { | ||
super(message); | ||
@@ -129,6 +131,7 @@ this.code = code; | ||
this.metadata = metadata; | ||
this.rawError = rawError; | ||
} | ||
toObject() { | ||
const { code, name, message, metadata, VERSIONS } = this; | ||
return { code, name, message, metadata, VERSIONS }; | ||
const { code, name, message, metadata, VERSIONS, rawError } = this; | ||
return { code, name, message, metadata, VERSIONS, rawError }; | ||
} | ||
@@ -135,0 +138,0 @@ }; |
@@ -103,6 +103,7 @@ "use strict"; | ||
ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error"; | ||
ErrorCode2["INVALID_MULTICALL"] = "invalid-multicall"; | ||
ErrorCode2["SCRIPT_REVERTED"] = "script-reverted"; | ||
ErrorCode2["SCRIPT_RETURN_INVALID_TYPE"] = "script-return-invalid-type"; | ||
ErrorCode2["STREAM_PARSING_ERROR"] = "stream-parsing-error"; | ||
ErrorCode2["NODE_LAUNCH_FAILED"] = "node-launch-failed"; | ||
ErrorCode2["UNKNOWN"] = "unknown"; | ||
return ErrorCode2; | ||
@@ -116,2 +117,3 @@ })(ErrorCode || {}); | ||
metadata; | ||
rawError; | ||
static parse(e) { | ||
@@ -136,3 +138,3 @@ const error = e; | ||
code; | ||
constructor(code, message, metadata = {}) { | ||
constructor(code, message, metadata = {}, rawError = {}) { | ||
super(message); | ||
@@ -142,6 +144,7 @@ this.code = code; | ||
this.metadata = metadata; | ||
this.rawError = rawError; | ||
} | ||
toObject() { | ||
const { code, name, message, metadata, VERSIONS } = this; | ||
return { code, name, message, metadata, VERSIONS }; | ||
const { code, name, message, metadata, VERSIONS, rawError } = this; | ||
return { code, name, message, metadata, VERSIONS, rawError }; | ||
} | ||
@@ -148,0 +151,0 @@ }; |
@@ -85,6 +85,7 @@ "use strict"; | ||
ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error"; | ||
ErrorCode2["INVALID_MULTICALL"] = "invalid-multicall"; | ||
ErrorCode2["SCRIPT_REVERTED"] = "script-reverted"; | ||
ErrorCode2["SCRIPT_RETURN_INVALID_TYPE"] = "script-return-invalid-type"; | ||
ErrorCode2["STREAM_PARSING_ERROR"] = "stream-parsing-error"; | ||
ErrorCode2["NODE_LAUNCH_FAILED"] = "node-launch-failed"; | ||
ErrorCode2["UNKNOWN"] = "unknown"; | ||
return ErrorCode2; | ||
@@ -123,6 +124,13 @@ })(ErrorCode || {}); | ||
} | ||
if (expectedError.message) { | ||
expect(thrownError.message).toEqual(expectedError.message); | ||
} | ||
if (expectedError.rawError) { | ||
expect(thrownError.rawError).toEqual(expectedError.rawError); | ||
} | ||
expect(thrownError.name).toEqual("FuelError"); | ||
expect(thrownError).toMatchObject(expectedError); | ||
return thrownError; | ||
}; | ||
})(); | ||
//# sourceMappingURL=test-utils.global.js.map |
@@ -110,6 +110,7 @@ "use strict"; | ||
ErrorCode2["VITEPRESS_PLUGIN_ERROR"] = "vitepress-plugin-error"; | ||
ErrorCode2["INVALID_MULTICALL"] = "invalid-multicall"; | ||
ErrorCode2["SCRIPT_REVERTED"] = "script-reverted"; | ||
ErrorCode2["SCRIPT_RETURN_INVALID_TYPE"] = "script-return-invalid-type"; | ||
ErrorCode2["STREAM_PARSING_ERROR"] = "stream-parsing-error"; | ||
ErrorCode2["NODE_LAUNCH_FAILED"] = "node-launch-failed"; | ||
ErrorCode2["UNKNOWN"] = "unknown"; | ||
return ErrorCode2; | ||
@@ -148,4 +149,11 @@ })(ErrorCode || {}); | ||
} | ||
if (expectedError.message) { | ||
expect(thrownError.message).toEqual(expectedError.message); | ||
} | ||
if (expectedError.rawError) { | ||
expect(thrownError.rawError).toEqual(expectedError.rawError); | ||
} | ||
expect(thrownError.name).toEqual("FuelError"); | ||
expect(thrownError).toMatchObject(expectedError); | ||
return thrownError; | ||
}; | ||
@@ -152,0 +160,0 @@ // Annotate the CommonJS export names for ESM import in node: |
import type { FuelError } from '../fuel-error'; | ||
type ExpectedFuelError = Partial<FuelError> & Required<Pick<FuelError, 'code'>>; | ||
export declare const expectToThrowFuelError: (lambda: () => unknown, expectedError: ExpectedFuelError) => Promise<void>; | ||
export declare const expectToThrowFuelError: (lambda: () => unknown, expectedError: ExpectedFuelError) => Promise<FuelError>; | ||
export {}; | ||
//# sourceMappingURL=expect-to-throw-fuel-error.d.ts.map |
{ | ||
"name": "@fuel-ts/errors", | ||
"version": "0.90.0", | ||
"version": "0.91.0", | ||
"description": "Error class and error codes that the fuels-ts library throws", | ||
@@ -10,3 +10,3 @@ "author": "Fuel Labs <contact@fuel.sh> (https://fuel.network/)", | ||
"engines": { | ||
"node": "^18.18.2 || ^20.0.0" | ||
"node": "^18.20.3 || ^20.0.0 || ^22.0.0" | ||
}, | ||
@@ -37,3 +37,3 @@ "exports": { | ||
"dependencies": { | ||
"@fuel-ts/versions": "0.90.0" | ||
"@fuel-ts/versions": "0.91.0" | ||
}, | ||
@@ -40,0 +40,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
118945
948
+ Added@fuel-ts/versions@0.91.0(transitive)
- Removed@fuel-ts/versions@0.90.0(transitive)
Updated@fuel-ts/versions@0.91.0