mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-09 22:57:59 -05:00
explorerd/error: enhance error module with parameterized errors and conversions
Enhanced the `explorerd` error module by introducing parameterized errors, improving error propagation through conversions, renaming for clarity, and refining JSON-RPC error handling. Updates include: - Renamed `RpcError` to `ExplorerdError` for use across all application layers (rpc, service, store) - Updated `ExplorerdError` to support parameterized error variants for more detailed and flexible error messages - Added conversions from `ExplorerdError` to `RpcError` and `Error` to aid with error propagation from individual RPC handlers to the `handle_request` method - Renamed `to_tuple` to `to_error_code_message` for improved readability and updated it to support parameterized errors - Revised the `server_error` function to construct `JsonError` responses using `ExplorerdError` - Updated Cargo.toml to include thiserror support - Updated `mod/ping_darkfid` function to use the updated `ExplorerdError`, including error details for additional context
This commit is contained in:
@@ -38,6 +38,7 @@ log = "0.4.26"
|
||||
lazy_static = "1.5.0"
|
||||
tar = "0.4.44"
|
||||
toml = "0.8.20"
|
||||
thiserror = "2.0.11"
|
||||
|
||||
# Testing
|
||||
tempdir = "0.3.7"
|
||||
|
||||
Reference in New Issue
Block a user