From b18d4b95642c462c75ebfbdb502cab93561b909d Mon Sep 17 00:00:00 2001 From: peaklabs-dev <122374094+peaklabs-dev@users.noreply.github.com> Date: Thu, 14 Nov 2024 17:51:58 +0100 Subject: [PATCH] dispatch an error message --- app/Livewire/Server/Show.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Livewire/Server/Show.php b/app/Livewire/Server/Show.php index a5544489d..243855e9d 100644 --- a/app/Livewire/Server/Show.php +++ b/app/Livewire/Server/Show.php @@ -113,7 +113,8 @@ class Show extends Component ->where('id', '!=', $this->server->id) ->exists()) { $this->ip = $this->server->ip; - throw new \Exception('This IP/Domain is already in use by another server in your team.'); + + return $this->dispatch('error', 'This IP/Domain is already in use by another server in your team.'); } $this->server->name = $this->name;