diff options
author | 2024-03-31 21:39:46 +0200 | |
---|---|---|
committer | 2024-03-31 21:39:46 +0200 | |
commit | facada6f8d5aecb5ce0bc2a13042622f93f15807 (patch) | |
tree | f872c48279d636df7bbea6edb56de4d5130c8fe5 /src/error.rs | |
parent | 7af7a7626a8e83fe3f9c3b0d2ad7d2b32da41d45 (diff) |
♻️ (error.rs): remove unnecessary error conversions for IllegalArgumentException and IllegalStateException
♻️ (ls_client.rs): refactor connect method to accept shutdown signal and return generic error
✨ (ls_client.rs): add support for graceful shutdown using Notify
✨ (ls_client.rs): implement session creation and subscription logic in connect method
♻️ (main.rs): replace SharedState with Notify for handling shutdown signal
✨ (main.rs): add retry logic with a maximum of 5 retries for the client connection in main function
✨ (main.rs): ensure graceful client disconnect and orderly shutdown of the application
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/error.rs b/src/error.rs index 9c3a916..cd1d7c2 100644 --- a/src/error.rs +++ b/src/error.rs @@ -22,12 +22,6 @@ impl Error for IllegalArgumentException { } } -impl From<Box<dyn Error>> for IllegalArgumentException { - fn from(error: Box<dyn Error>) -> Self { - IllegalArgumentException::new(&error.to_string()) - } -} - #[derive(Debug)] pub struct IllegalStateException { details: String @@ -49,22 +43,4 @@ impl Error for IllegalStateException { fn description(&self) -> &str { &self.details } -} - -impl From<Box<dyn Error>> for IllegalStateException { - fn from(error: Box<dyn Error>) -> Self { - IllegalStateException::new(&error.to_string()) - } -} - -impl From<serde_urlencoded::ser::Error> for IllegalStateException { - fn from(err: serde_urlencoded::ser::Error) -> Self { - IllegalStateException::new(&format!("Serialization error: {}", err)) - } -} - -impl From<tokio_tungstenite::tungstenite::Error> for IllegalStateException { - fn from(err: tokio_tungstenite::tungstenite::Error) -> Self { - IllegalStateException::new(&format!("WebSocket error: {}", err)) - } }
\ No newline at end of file |