zksync-era icon indicating copy to clipboard operation
zksync-era copied to clipboard

Update ClientError enum with additional error variants

Open jigarparmar519 opened this issue 1 year ago • 0 comments
trafficstars

Description: This pull request updates the ClientError enum and error handling in the zkSync Rust SDK. The changes aim to improve clarity, consistency, and error reporting in the client library.

Changes Made:

Modified the ClientError enum to include additional error variants and restructured existing variants for better organization. Imported the SignerError type from zksync_eth_signer::error to handle signing errors. Renamed the imported ClientError from zksync_web3_decl::jsonrpsee::core to RpcError for clarity. Refactored error messages and added new variants to provide more specific information about various error conditions. Reasons for the Changes:

The existing ClientError enum lacked clarity and consistency, making it difficult to understand and handle different error scenarios. By restructuring the enum and adding new variants, we can provide more detailed and informative error messages to users, developers, and integrators. Importing SignerError allows us to handle signing errors more robustly and provides better integration with the zkSync ecosystem. Renaming the ClientError import to RpcError aligns with naming conventions and improves code readability. Testing Done:

Unit tests have been updated to cover the new error variants and ensure that error handling functions correctly in different scenarios. Manual testing has been performed to verify that error messages are displayed correctly and convey accurate information to users. Screenshots (if applicable): N/A

Checklist:

Tested changes locally. Verified that changes do not introduce new errors or warnings. Reviewed code to ensure compliance with coding standards. Updated relevant documentation. Discussed changes with team members for feedback and approval. Additional Comments: These changes should improve the usability and reliability of the zkSync Rust SDK by providing clearer error messages and more robust error handling. Feedback and suggestions for further improvements are welcome.

jigarparmar519 avatar Feb 22 '24 16:02 jigarparmar519