@@ -45,7 +45,7 @@ public function __construct(
4545 $ this ->redis ->setOption (Redis::OPT_PREFIX , $ this ->keyPrefix );
4646 } catch (Exception $ e ) {
4747 $ this ->logger ?->error(self ::FAILED_TO_INITIALIZE .$ e ->getMessage ());
48- throw new \ Exception (self ::FAILED_TO_INITIALIZE .$ e ->getMessage ());
48+ throw new SseAdapterException (self ::FAILED_TO_INITIALIZE .$ e ->getMessage ());
4949 }
5050 }
5151
@@ -55,7 +55,7 @@ public function __construct(
5555 * @param string $clientId The unique identifier for the client
5656 * @param string $message The message to be queued
5757 *
58- * @throws Exception If the message cannot be added to the queue
58+ * @throws SseAdapterException If the message cannot be added to the queue
5959 */
6060 public function pushMessage (string $ clientId , string $ message ): void
6161 {
@@ -68,7 +68,7 @@ public function pushMessage(string $clientId, string $message): void
6868
6969 } catch (Exception $ e ) {
7070 $ this ->logger ?->error('Failed to add message to Redis queue: ' .$ e ->getMessage ());
71- throw new Exception ('Failed to add message to Redis queue: ' .$ e ->getMessage ());
71+ throw new SseAdapterException ('Failed to add message to Redis queue: ' .$ e ->getMessage ());
7272 }
7373 }
7474
@@ -88,7 +88,7 @@ protected function getQueueKey(string $clientId): string
8888 *
8989 * @param string $clientId The unique identifier for the client
9090 *
91- * @throws Exception If the messages cannot be removed
91+ * @throws SseAdapterException If the messages cannot be removed
9292 */
9393 public function removeAllMessages (string $ clientId ): void
9494 {
@@ -99,7 +99,7 @@ public function removeAllMessages(string $clientId): void
9999
100100 } catch (Exception $ e ) {
101101 $ this ->logger ?->error('Failed to remove messages from Redis queue: ' .$ e ->getMessage ());
102- throw new Exception ('Failed to remove messages from Redis queue: ' .$ e ->getMessage ());
102+ throw new SseAdapterException ('Failed to remove messages from Redis queue: ' .$ e ->getMessage ());
103103 }
104104 }
105105
@@ -109,7 +109,7 @@ public function removeAllMessages(string $clientId): void
109109 * @param string $clientId The unique identifier for the client
110110 * @return array<string> Array of messages
111111 *
112- * @throws Exception If the messages cannot be retrieved
112+ * @throws SseAdapterException If the messages cannot be retrieved
113113 */
114114 public function receiveMessages (string $ clientId ): array
115115 {
@@ -123,7 +123,7 @@ public function receiveMessages(string $clientId): array
123123
124124 return $ messages ;
125125 } catch (Exception $ e ) {
126- throw new Exception ('Failed to receive messages from Redis queue: ' .$ e ->getMessage ());
126+ throw new SseAdapterException ('Failed to receive messages from Redis queue: ' .$ e ->getMessage ());
127127 }
128128 }
129129
@@ -133,7 +133,7 @@ public function receiveMessages(string $clientId): array
133133 * @param string $clientId The unique identifier for the client
134134 * @return string|null The message or null if the queue is empty
135135 *
136- * @throws Exception If the message cannot be popped
136+ * @throws SseAdapterException If the message cannot be popped
137137 */
138138 public function popMessage (string $ clientId ): ?string
139139 {
@@ -149,7 +149,7 @@ public function popMessage(string $clientId): ?string
149149 return $ message ;
150150 } catch (Exception $ e ) {
151151 $ this ->logger ?->error('Failed to pop message from Redis queue: ' .$ e ->getMessage ());
152- throw new Exception ('Failed to pop message from Redis queue: ' .$ e ->getMessage ());
152+ throw new SseAdapterException ('Failed to pop message from Redis queue: ' .$ e ->getMessage ());
153153 }
154154 }
155155
@@ -201,7 +201,7 @@ public function getMessageCount(string $clientId): int
201201 * @param string $clientId The unique identifier for the client
202202 * @param int|null $timestamp The timestamp to store (defaults to current time if null)
203203 *
204- * @throws Exception If the timestamp cannot be stored
204+ * @throws SseAdapterException If the timestamp cannot be stored
205205 */
206206 public function storeLastPongResponseTimestamp (string $ clientId , ?int $ timestamp = null ): void
207207 {
@@ -214,7 +214,7 @@ public function storeLastPongResponseTimestamp(string $clientId, ?int $timestamp
214214
215215 } catch (Exception $ e ) {
216216 $ this ->logger ?->error('Failed to store last pong timestamp: ' .$ e ->getMessage ());
217- throw new Exception ('Failed to store last pong timestamp: ' .$ e ->getMessage ());
217+ throw new SseAdapterException ('Failed to store last pong timestamp: ' .$ e ->getMessage ());
218218 }
219219 }
220220
@@ -224,7 +224,7 @@ public function storeLastPongResponseTimestamp(string $clientId, ?int $timestamp
224224 * @param string $clientId The unique identifier for the client
225225 * @return int|null The timestamp or null if no timestamp is stored
226226 *
227- * @throws Exception If the timestamp cannot be retrieved
227+ * @throws SseAdapterException If the timestamp cannot be retrieved
228228 */
229229 public function getLastPongResponseTimestamp (string $ clientId ): ?int
230230 {
@@ -241,7 +241,7 @@ public function getLastPongResponseTimestamp(string $clientId): ?int
241241
242242 } catch (Exception $ e ) {
243243 $ this ->logger ?->error('Failed to get last pong timestamp: ' .$ e ->getMessage ());
244- throw new Exception ('Failed to get last pong timestamp: ' .$ e ->getMessage ());
244+ throw new SseAdapterException ('Failed to get last pong timestamp: ' .$ e ->getMessage ());
245245 }
246246 }
247247}
0 commit comments