web3-errors
Advanced tools
Comparing version 1.2.2-dev.0db2b18.0 to 1.2.2-dev.2ef694c.0
@@ -7,6 +7,8 @@ import { JsonRpcPayload, JsonRpcResponse } from 'web3-types'; | ||
request?: JsonRpcPayload<RequestType>; | ||
constructor(response: JsonRpcResponse<unknown, ErrorType>, message?: string, request?: JsonRpcPayload<RequestType>); | ||
statusCode?: number; | ||
constructor(response: JsonRpcResponse<unknown, ErrorType>, message?: string, request?: JsonRpcPayload<RequestType>, statusCode?: number); | ||
toJSON(): { | ||
data: ErrorType | ErrorType[] | undefined; | ||
request: JsonRpcPayload<RequestType> | undefined; | ||
statusCode: number | undefined; | ||
name: string; | ||
@@ -13,0 +15,0 @@ code: number; |
@@ -33,3 +33,3 @@ "use strict"; | ||
class ResponseError extends web3_error_base_js_1.BaseWeb3Error { | ||
constructor(response, message, request) { | ||
constructor(response, message, request, statusCode) { | ||
var _a; | ||
@@ -45,2 +45,3 @@ super(message !== null && message !== void 0 ? message : `Returned error: ${Array.isArray(response) | ||
} | ||
this.statusCode = statusCode; | ||
this.request = request; | ||
@@ -62,3 +63,3 @@ let errorOrErrors; | ||
toJSON() { | ||
return Object.assign(Object.assign({}, super.toJSON()), { data: this.data, request: this.request }); | ||
return Object.assign(Object.assign({}, super.toJSON()), { data: this.data, request: this.request, statusCode: this.statusCode }); | ||
} | ||
@@ -65,0 +66,0 @@ } |
@@ -30,3 +30,3 @@ /* | ||
export class ResponseError extends BaseWeb3Error { | ||
constructor(response, message, request) { | ||
constructor(response, message, request, statusCode) { | ||
var _a; | ||
@@ -42,2 +42,3 @@ super(message !== null && message !== void 0 ? message : `Returned error: ${Array.isArray(response) | ||
} | ||
this.statusCode = statusCode; | ||
this.request = request; | ||
@@ -59,3 +60,3 @@ let errorOrErrors; | ||
toJSON() { | ||
return Object.assign(Object.assign({}, super.toJSON()), { data: this.data, request: this.request }); | ||
return Object.assign(Object.assign({}, super.toJSON()), { data: this.data, request: this.request, statusCode: this.statusCode }); | ||
} | ||
@@ -62,0 +63,0 @@ } |
@@ -7,6 +7,8 @@ import { JsonRpcPayload, JsonRpcResponse } from 'web3-types'; | ||
request?: JsonRpcPayload<RequestType>; | ||
constructor(response: JsonRpcResponse<unknown, ErrorType>, message?: string, request?: JsonRpcPayload<RequestType>); | ||
statusCode?: number; | ||
constructor(response: JsonRpcResponse<unknown, ErrorType>, message?: string, request?: JsonRpcPayload<RequestType>, statusCode?: number); | ||
toJSON(): { | ||
data: ErrorType | ErrorType[] | undefined; | ||
request: JsonRpcPayload<RequestType> | undefined; | ||
statusCode: number | undefined; | ||
name: string; | ||
@@ -13,0 +15,0 @@ code: number; |
{ | ||
"name": "web3-errors", | ||
"version": "1.2.2-dev.0db2b18.0+0db2b18", | ||
"version": "1.2.2-dev.2ef694c.0+2ef694c", | ||
"description": "This package has web3 error classes", | ||
@@ -44,3 +44,3 @@ "main": "./lib/commonjs/index.js", | ||
"dependencies": { | ||
"web3-types": "1.7.1-dev.0db2b18.0+0db2b18" | ||
"web3-types": "1.7.1-dev.2ef694c.0+2ef694c" | ||
}, | ||
@@ -61,3 +61,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "0db2b18418b232d431dd5c2f6a543b66d27451a3" | ||
"gitHead": "2ef694cc5b40cf44f4ec46c60e183970d2f5c18e" | ||
} |
@@ -48,2 +48,3 @@ /* | ||
public request?: JsonRpcPayload<RequestType>; | ||
public statusCode?: number; | ||
@@ -54,2 +55,3 @@ public constructor( | ||
request?: JsonRpcPayload<RequestType>, | ||
statusCode?: number | ||
) { | ||
@@ -71,2 +73,3 @@ super( | ||
this.statusCode = statusCode; | ||
this.request = request; | ||
@@ -88,3 +91,3 @@ let errorOrErrors: JsonRpcError | JsonRpcError[] | undefined; | ||
public toJSON() { | ||
return { ...super.toJSON(), data: this.data, request: this.request }; | ||
return { ...super.toJSON(), data: this.data, request: this.request, statusCode: this.statusCode }; | ||
} | ||
@@ -91,0 +94,0 @@ } |
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
416441
7459