web3-errors
Advanced tools
Comparing version 1.3.1-dev.7a6e492.0 to 1.3.1-dev.7a8df69.0
@@ -71,3 +71,3 @@ import { JsonRpcError, TransactionReceipt, HexString } from 'web3-types'; | ||
} | ||
export declare type ProviderErrorData = HexString | { | ||
export type ProviderErrorData = HexString | { | ||
data: HexString; | ||
@@ -104,7 +104,5 @@ } | { | ||
data: string; | ||
errorName?: string | undefined; | ||
errorSignature?: string | undefined; | ||
errorArgs?: { | ||
[x: string]: unknown; | ||
} | undefined; | ||
errorName?: string; | ||
errorSignature?: string; | ||
errorArgs?: { [K in string]: unknown; }; | ||
}; | ||
@@ -111,0 +109,0 @@ } |
@@ -114,2 +114,3 @@ "use strict"; | ||
this.name = ('name' in error && error.name) || this.constructor.name; | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
this.stack = ('stack' in error && error.stack) || undefined; | ||
@@ -116,0 +117,0 @@ this.code = error.code; |
@@ -25,19 +25,2 @@ "use strict"; | ||
class BaseWeb3Error extends Error { | ||
constructor(msg, cause) { | ||
super(msg); | ||
if (Array.isArray(cause)) { | ||
// eslint-disable-next-line no-use-before-define | ||
this.cause = new MultipleErrors(cause); | ||
} | ||
else { | ||
this.cause = cause; | ||
} | ||
this.name = this.constructor.name; | ||
if (typeof Error.captureStackTrace === 'function') { | ||
Error.captureStackTrace(new.target.constructor); | ||
} | ||
else { | ||
this.stack = new Error().stack; | ||
} | ||
} | ||
/** | ||
@@ -65,2 +48,19 @@ * @deprecated Use the `cause` property instead. | ||
} | ||
constructor(msg, cause) { | ||
super(msg); | ||
if (Array.isArray(cause)) { | ||
// eslint-disable-next-line no-use-before-define | ||
this.cause = new MultipleErrors(cause); | ||
} | ||
else { | ||
this.cause = cause; | ||
} | ||
this.name = this.constructor.name; | ||
if (typeof Error.captureStackTrace === 'function') { | ||
Error.captureStackTrace(new.target.constructor); | ||
} | ||
else { | ||
this.stack = new Error().stack; | ||
} | ||
} | ||
static convertToString(value, unquotValue = false) { | ||
@@ -67,0 +67,0 @@ // Using "null" value intentionally for validation |
@@ -101,2 +101,3 @@ /* | ||
this.name = ('name' in error && error.name) || this.constructor.name; | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
this.stack = ('stack' in error && error.stack) || undefined; | ||
@@ -103,0 +104,0 @@ this.code = error.code; |
@@ -22,19 +22,2 @@ /* | ||
export class BaseWeb3Error extends Error { | ||
constructor(msg, cause) { | ||
super(msg); | ||
if (Array.isArray(cause)) { | ||
// eslint-disable-next-line no-use-before-define | ||
this.cause = new MultipleErrors(cause); | ||
} | ||
else { | ||
this.cause = cause; | ||
} | ||
this.name = this.constructor.name; | ||
if (typeof Error.captureStackTrace === 'function') { | ||
Error.captureStackTrace(new.target.constructor); | ||
} | ||
else { | ||
this.stack = new Error().stack; | ||
} | ||
} | ||
/** | ||
@@ -62,2 +45,19 @@ * @deprecated Use the `cause` property instead. | ||
} | ||
constructor(msg, cause) { | ||
super(msg); | ||
if (Array.isArray(cause)) { | ||
// eslint-disable-next-line no-use-before-define | ||
this.cause = new MultipleErrors(cause); | ||
} | ||
else { | ||
this.cause = cause; | ||
} | ||
this.name = this.constructor.name; | ||
if (typeof Error.captureStackTrace === 'function') { | ||
Error.captureStackTrace(new.target.constructor); | ||
} | ||
else { | ||
this.stack = new Error().stack; | ||
} | ||
} | ||
static convertToString(value, unquotValue = false) { | ||
@@ -64,0 +64,0 @@ // Using "null" value intentionally for validation |
@@ -71,3 +71,3 @@ import { JsonRpcError, TransactionReceipt, HexString } from 'web3-types'; | ||
} | ||
export declare type ProviderErrorData = HexString | { | ||
export type ProviderErrorData = HexString | { | ||
data: HexString; | ||
@@ -104,7 +104,5 @@ } | { | ||
data: string; | ||
errorName?: string | undefined; | ||
errorSignature?: string | undefined; | ||
errorArgs?: { | ||
[x: string]: unknown; | ||
} | undefined; | ||
errorName?: string; | ||
errorSignature?: string; | ||
errorArgs?: { [K in string]: unknown; }; | ||
}; | ||
@@ -111,0 +109,0 @@ } |
{ | ||
"name": "web3-errors", | ||
"version": "1.3.1-dev.7a6e492.0+7a6e492", | ||
"version": "1.3.1-dev.7a8df69.0+7a8df69", | ||
"description": "This package has web3 error classes", | ||
@@ -44,3 +44,3 @@ "main": "./lib/commonjs/index.js", | ||
"dependencies": { | ||
"web3-types": "1.7.1-dev.7a6e492.0+7a6e492" | ||
"web3-types": "1.9.1-dev.7a8df69.0+7a8df69" | ||
}, | ||
@@ -59,5 +59,5 @@ "devDependencies": { | ||
"ts-jest": "^29.1.1", | ||
"typescript": "^4.7.4" | ||
"typescript": "^5.5.4" | ||
}, | ||
"gitHead": "7a6e49200949325f69a05b3bf465ce64eb41bb8d" | ||
"gitHead": "7a8df69b8aca8718d4e862955a12c6944a701f6b" | ||
} |
@@ -163,3 +163,2 @@ /* | ||
// Core error codes | ||
@@ -166,0 +165,0 @@ export const ERR_CORE_HARDFORK_MISMATCH = 1101; |
@@ -153,2 +153,3 @@ /* | ||
this.name = ('name' in error && error.name) || this.constructor.name; | ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
this.stack = ('stack' in error && error.stack) || undefined; | ||
@@ -155,0 +156,0 @@ this.code = error.code; |
@@ -54,3 +54,3 @@ /* | ||
request?: JsonRpcPayload<RequestType>, | ||
statusCode?: number | ||
statusCode?: number, | ||
) { | ||
@@ -89,3 +89,8 @@ super( | ||
public toJSON() { | ||
return { ...super.toJSON(), data: this.data, request: this.request, statusCode: this.statusCode }; | ||
return { | ||
...super.toJSON(), | ||
data: this.data, | ||
request: this.request, | ||
statusCode: this.statusCode, | ||
}; | ||
} | ||
@@ -116,2 +121,2 @@ } | ||
} | ||
} | ||
} |
@@ -31,3 +31,2 @@ /* | ||
} | ||
} |
@@ -84,3 +84,2 @@ /* | ||
super(value, 'not a valid unit. Must be a positive integer'); | ||
} | ||
@@ -87,0 +86,0 @@ } |
@@ -33,2 +33,2 @@ /* | ||
export * from './errors/rpc_error_messages.js'; | ||
export * from './errors/schema_errors.js'; | ||
export * from './errors/schema_errors.js'; |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
418569
191990
143
7465
8
40