neo-go
neo-go copied to clipboard
rpc: take care of response errors and error codes
- We should carefully distinguish all kinds of RPC errors (parameters parsing errors / handling errors / server errors / etc.) on the server side. Each meaningful error should have a separate meaningful error code.
- All possible errors for each RPC call should be documented.
- All possible errors should be presented as exported variables and have proper comments for external users.
- RPC client should be able to distinguish errors by codes and should return these specific errors. Users should be able to identify them via
errors.Is(...) - All errors and error codes should be compatible with the reference implementation, so we may add an issue about errors naming to neo-modules repo.
#2544 fixes №3 and №4, but we still need to synchronize with C#, extend the set of errors and then extend the documentation.
№1, №2 and №5 are dependent on the https://github.com/neo-project/neo-modules/issues/728.