Skip to content

Commit

Permalink
Error messages refactoring (#1854)
Browse files Browse the repository at this point in the history
* use VMError instead of String in FunctionCall error
* some progress on errors
* errors refactor
* revert changes (rename fields)
* test pass
* error view update
* WIP
* make it compile
* tests pass
* action index added to ActionError
* action index added: test pass
* merge statging
* FunctionCall(String) -> FunctionCall(VMError)
* rpctypegen start
* continue with RpcError derive_macro
* continue working
* errors JSON schema generation done
* Do not rewrite the schema file. Merge error schemas instead.
* small fix
* VMErrors refactoring
* expose errors schema
* rename rpc_errors_schema.json
* merge staging
* specify a nearlib revision to test against
* fix tests
* fix merge
* fix rpctypegen build
* Merge branch 'staging' into fckt/rpc-errors
* fix ci: exclude near_rpc_error_macro from tests
* Merge branch 'staging' into fckt/rpc-errors
* Merge branch 'staging' into fckt/rpc-errors
* add Errors docs, rename error types fix Balance formatting
* fix formatting
* Merge branch 'staging' into fckt/rpc-errors
* make schema deterministic
* Update core/primitives/src/errors.rs

Co-Authored-By: Evgeny Kuzyakov <ek@nearprotocol.com>
* Update core/primitives/src/errors.rs

Co-Authored-By: Evgeny Kuzyakov <ek@nearprotocol.com>
* Update core/primitives/src/errors.rs

Co-Authored-By: Evgeny Kuzyakov <ek@nearprotocol.com>
* Apply suggestions from code review

Co-Authored-By: Evgeny Kuzyakov <ek@nearprotocol.com>
* return ActionErrorKind::ActorNoPermission on AccountDelete and not sir
* Merge branch 'fckt/rpc-errors' of github.com:nearprotocol/nearcore into fckt/rpc-errors
*  StorageError doc comment addition
* update BalanceMismatch doc comment
* Apply suggestions from code review

Co-Authored-By: Evgeny Kuzyakov <ek@nearprotocol.com>
* Merge branch 'staging' into fckt/rpc-errors
* ActionError index doc added
* Merge branch 'fckt/rpc-errors' of github.com:nearprotocol/nearcore into fckt/rpc-errors
* fix check_actor_permissions for DeleteAccount
* no cargo clean in build_errors_schema.sh and move to scripts
* feature-gated schema dump generation
* Merge branch 'staging' into fckt/rpc-errors
* Update tools/rpctypegen/Cargo.toml

Co-Authored-By: Maksym Zavershynskyi <35039879+nearmax@users.noreply.github.com>
* removed rpc_error_variant attribute
* split rpctypegen into core and macro crated + tests added
* Merge branch 'staging' into fckt/rpc-errors
* ServerError Display impl
* moved build_errors_schema.sh and res/rpc_errors_schema.json to a json-rpc crate
* fix rpc-errors test
* ActionError -> RequiresFullAccess
* Merge branch 'staging' into fckt/rpc-errors
* fix comment

Co-Authored-By: Evgeny Kuzyakov <ek@nearprotocol.com>
  • Loading branch information
2 people authored and nearprotocol-bulldozer[bot] committed Jan 22, 2020
1 parent c0231a0 commit da9e48b
Show file tree
Hide file tree
Showing 41 changed files with 1,863 additions and 581 deletions.
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ members = [
"test-utils/loadtester",
"test-utils/state-viewer",
"near/",
"tools/rpctypegen/core",
"tools/rpctypegen/macro",
"genesis-tools/genesis-csv-to-json",
"genesis-tools/genesis-populate",
"genesis-tools/keypair-generator",
Expand Down
8 changes: 7 additions & 1 deletion chain/jsonrpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ serde_derive = "1.0"
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
uuid = { version = "~0.8", features = ["v4"] }

borsh = "0.2.10"

near-crypto = { path = "../../core/crypto" }
Expand All @@ -33,3 +32,10 @@ near-client = { path = "../client" }
near-network = { path = "../network" }
near-pool = { path = "../pool" }
near-jsonrpc-client = { path = "client" }
near-rpc-error-macro = { path = "../../tools/rpctypegen/macro" }

[build-dependencies]
_rand = { package = "rand", version = "0.6.5" }

[features]
dump_errors_schema = ["near-rpc-error-macro/dump_errors_schema"]
3 changes: 3 additions & 0 deletions chain/jsonrpc/build_errors_schema.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cargo build --features dump_errors_schema
cp ../../target/rpc_errors_schema.json ./res/rpc_errors_schema.json
Loading

0 comments on commit da9e48b

Please sign in to comment.