success($successMessage, css: 'alert-success alert-dismissible alert-soft'); } } catch (ValidationException $exception) { /** * We are catching this exception intentionally so that, generic throwable catch block * doesn't catch this, which will lead to close the modal. * * But, we are rethrowing this so that validation errors can be handled by others. */ throw $exception; } catch (Throwable $exception) { if (null !== $onError) { // call the callback $onError(); } $this->error($errorMessage, css: 'alert-error alert-dismissible alert-soft'); Log::error($exception->getMessage()); } } }