Socket
Socket
Sign inDemoInstall

web3-errors

Package Overview
Dependencies
Maintainers
5
Versions
298
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

web3-errors - npm Package Compare versions

Comparing version 1.2.2-dev.5080e80.0 to 1.2.2-dev.60fc197.0

4

lib/commonjs/errors/response_errors.d.ts

@@ -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.5080e80.0+5080e80",
"version": "1.2.2-dev.60fc197.0+60fc197",
"description": "This package has web3 error classes",

@@ -44,3 +44,3 @@ "main": "./lib/commonjs/index.js",

"dependencies": {
"web3-types": "1.7.1-dev.5080e80.0+5080e80"
"web3-types": "1.7.1-dev.60fc197.0+60fc197"
},

@@ -61,3 +61,3 @@ "devDependencies": {

},
"gitHead": "5080e80fe3e55494b2871e7906670807b086383b"
"gitHead": "60fc1979820fa7be3b6052ccca8397ee75032631"
}

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc