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 4902 (unsupportedChain) error getting wrapped as -32603 & Fork eth-rpc-errors #954

Merged
merged 5 commits into from
Jul 28, 2023

Conversation

bangtoven
Copy link
Contributor

Summary

How did you test your changes?

@bangtoven bangtoven changed the title Jungho/errors Fix 4902 (unsupportedChain) error getting wrapped as -32603 & Fork eth-rpc-errors Jul 27, 2023
@bangtoven bangtoven requested a review from cb-jake July 27, 2023 00:54
serialized.data = { originalError: assignOriginalError(error) };
}

const stack = (error as any)?.stack;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should follow the same pattern here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could make this generic and use it for both cases

function hasProperty(obj: unknown, prop: string): obj is {stack: string} {
  return typeof obj === 'object' && obj !== null && prop in obj;
}

const stack = hasProperty(error, 'stack') ? error.stack : undefined

@bangtoven bangtoven requested a review from cb-jake July 27, 2023 17:03
@bangtoven bangtoven marked this pull request as ready for review July 27, 2023 17:03
@bangtoven bangtoven merged commit 8b13d0a into master Jul 28, 2023
@bangtoven bangtoven deleted the jungho/errors branch July 28, 2023 20:30
bangtoven added a commit that referenced this pull request Oct 20, 2023
…h-rpc-errors (#954)

# Conflicts:
#	packages/wallet-sdk/package.json
#	packages/wallet-sdk/src/errors.ts
#	packages/wallet-sdk/src/errors/serialize.test.ts
#	yarn.lock
bangtoven added a commit that referenced this pull request Oct 26, 2023
…h-rpc-errors (#954) (#1035)

# Conflicts:
#	packages/wallet-sdk/package.json
#	packages/wallet-sdk/src/errors.ts
#	packages/wallet-sdk/src/errors/serialize.test.ts
#	yarn.lock
bangtoven added a commit that referenced this pull request Feb 29, 2024
bangtoven added a commit that referenced this pull request Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants