Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typing of error data and stack properties #34

Merged
merged 2 commits into from
Nov 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface SerializedEthereumRpcError {
code: number; // must be an integer
message: string;
data?: unknown;
stack?: unknown;
stack?: string;
}

/**
Expand All @@ -16,7 +16,7 @@ export class EthereumRpcError<T> extends Error {

public code: number;

public data: T | undefined;
public data?: T;

constructor(code: number, message: string, data?: T) {

Expand Down Expand Up @@ -76,7 +76,7 @@ export class EthereumProviderError<T> extends EthereumRpcError<T> {

/**
* Create an Ethereum Provider JSON-RPC error.
* `code` must be an integer in the [ 1000 <= 4999 ] range.
* `code` must be an integer in the 1000 <= 4999 range.
*/
constructor(code: number, message: string, data?: T) {

Expand Down