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

Display user-friendly messages for JSON RPC errors #1275

Merged
merged 16 commits into from
Feb 8, 2024

Conversation

denbite
Copy link
Contributor

@denbite denbite commented Jan 21, 2024

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this changes code in a published package: I have run pnpm changeset to create a changeset JSON document appropriate for this change.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Added error parsing to JsonRpcProvider when the error message is under the response.result key to prevent users from seeing raw errors

Before

image image image

After

image image image

Test Plan

Related issues/PRs

#1028

Copy link

changeset-bot bot commented Jan 21, 2024

🦋 Changeset detected

Latest commit: 2815f1e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@near-js/providers Minor
@near-js/utils Minor
@near-js/accounts Patch
@near-js/cookbook Patch
near-api-js Patch
@near-js/biometric-ed25519 Patch
@near-js/crypto Patch
@near-js/transactions Patch
@near-js/wallet-account Patch
@near-js/keystores-browser Patch
@near-js/keystores-node Patch
@near-js/keystores Patch
@near-js/signers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

gtsonevv
gtsonevv previously approved these changes Jan 22, 2024
vikinatora
vikinatora previously approved these changes Jan 22, 2024
Copy link
Collaborator

@vikinatora vikinatora left a comment

Choose a reason for hiding this comment

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

lgtm, just adjust the changeset

.changeset/red-mice-argue.md Outdated Show resolved Hide resolved
@denbite denbite dismissed stale reviews from vikinatora and gtsonevv via 93f24ae January 22, 2024 16:20
@denbite
Copy link
Contributor Author

denbite commented Jan 22, 2024

lgtm, just adjust the changeset

done

vikinatora
vikinatora previously approved these changes Jan 23, 2024
@vikinatora
Copy link
Collaborator

Hey @denbite, please resolve the CI issues and we're ready to merge!

vikinatora
vikinatora previously approved these changes Jan 25, 2024
@vikinatora
Copy link
Collaborator

@denbite there are still two test errors
image

@vikinatora
Copy link
Collaborator

@denbite there are errors again, you can run pnpm run test from the root directory in order to run the tests locally. This will make sure you're not revisiting the PR every day

@denbite
Copy link
Contributor Author

denbite commented Jan 28, 2024

let's run checks again, this time it will pass

@denbite
Copy link
Contributor Author

denbite commented Jan 28, 2024

I had difficulty running tests locally on the M1 chip, but I was able to fix it and opened the Pull Request to merge it
let's make sure it will be merged asap #1283

vikinatora
vikinatora previously approved these changes Jan 29, 2024
@denbite
Copy link
Contributor Author

denbite commented Jan 29, 2024

I believe it should work now, have tested all packages

@denbite
Copy link
Contributor Author

denbite commented Feb 6, 2024

@vikinatora do you know if this RPC https://rpc.ci-testnet.near.org is used for running tests here?
I had to remove a part of the code in one of the tests to pass it locally (this seemed like a mandatory update after upgrading the RPC schema), but here it hadn't passed anyway

image

so I reverted changes back in 2815f1e

@vikinatora vikinatora merged commit bdaed65 into near:master Feb 8, 2024
1 check passed
This was referenced Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants