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:
kalm
2025-03-24 01:13:22 -07:00
parent 6ccf08e924
commit 83478ad50d
3 changed files with 62 additions and 28 deletions

View File

@@ -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"