From f56ce26a74a0bb78d13006f2413063f74e28c15f Mon Sep 17 00:00:00 2001 From: Ernestas Kvedaras Date: Fri, 18 Feb 2022 11:00:08 +0100 Subject: [PATCH] Introduce `ConnectionLostException` --- .gitignore | 1 + src/Console/Commands/EventStoreWorkerThread.php | 3 ++- src/Exceptions/ConnectionLostException.php | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/Exceptions/ConnectionLostException.php diff --git a/.gitignore b/.gitignore index 209d6aa..e8b7dde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ vendor composer.lock +.idea .phpunit.result.cache build .env diff --git a/src/Console/Commands/EventStoreWorkerThread.php b/src/Console/Commands/EventStoreWorkerThread.php index e4e0040..1f72121 100644 --- a/src/Console/Commands/EventStoreWorkerThread.php +++ b/src/Console/Commands/EventStoreWorkerThread.php @@ -3,6 +3,7 @@ namespace DigitalRisks\LaravelEventStore\Console\Commands; use DigitalRisks\LaravelEventStore\EventStore as LaravelEventStore; +use DigitalRisks\LaravelEventStore\Exceptions\ConnectionLostException; use DigitalRisks\LaravelEventStore\Services\EventStoreEventService; use EventLoop\EventLoop; use Illuminate\Console\Command; @@ -46,7 +47,7 @@ public function handle(): void report($e); } - report(new \Exception('Lost connection with EventStore - reconnecting')); + report(new ConnectionLostException()); sleep(1); $this->handle(); diff --git a/src/Exceptions/ConnectionLostException.php b/src/Exceptions/ConnectionLostException.php new file mode 100644 index 0000000..63080d0 --- /dev/null +++ b/src/Exceptions/ConnectionLostException.php @@ -0,0 +1,13 @@ +