Throw exception in panel message - hook

Hi,

i am writing on hooks inside a plugin and even though i am coming until the “success” exception it’s still throwing out an error on the message dialog

Das Formular konnte nicht gespeichert werden
Exception: Exception

Exception: Funktioniert.

Even though all tasks the hook is supposed to do, are completed as well.

            try {
                $kirby->impersonate('kirby');
                $newSite->update([
   
                    'lastAction' => 'Die E-Mail wurde an '.$i.' Personen versendet',

                ],$kirby->language()->code());          //code...
                throw new Exception('Funktioniert..'); 
            } catch (\Throwable $th) {
                throw new Exception($th); //throw $th;
            }   

Exception: Funktioniert.. in C:\site\plugins\cg-n\registry\hooks\sendMail.php:81 Stack trace: #0 [internal function]: Kirby\Cms\App->{closure}(Object(Kirby\Cms\Site), Object(Kirby\Cms\Site)) #1 C:\\kirby\src\Toolkit\Controller.php(50): Closure->call(Object(Kirby\Cms\App), Object(Kirby\Cms\Site), Object(Kirby\Cms\Site)) #2 C:\\kirby\src\Cms\Event.php(169): Kirby\Toolkit\Controller->call(Object(Kirby\Cms\App), Array) #3 C:\\kirby\src\Cms\App.php(1501): Kirby\Cms\Event->call(Object(Kirby\Cms\App), Object(Kirby\Toolkit\Controller)) #4 C:\\kirby\src\Cms\SiteActions.php(43): Kirby\Cms\App->trigger('site.update:aft...', Array) #5 C:\\kirby\src\Cms\ModelWithContent.php(625): Kirby\Cms\Site->commit('update', Array, Object(Closure)) #6 C:\\kirby\config\api\routes\site.php(18): Kirby\Cms\ModelWithContent->update(Array, 'de', true) #7 [internal function]: Kirby\Cms\Api->{closure}() #8 C:\\kirby\src\Api\Api.php(210): Closure->call(Object(Kirby\Cms\Api)) #9 C:\\kirby\src\Cms\Api.php(49): Kirby\Api\Api->call('site', 'PATCH', Array) #10 C:\\kirby\src\Api\Api.php(593): Kirby\Cms\Api->call('site', 'PATCH', Array) #11 C:\\kirby\config\routes.php(45): Kirby\Api\Api->render('site', 'PATCH', Array) #12 [internal function]: Kirby\Http\Route->{closure}('site') #13 C:\\kirby\src\Http\Router.php(107): Closure->call(Object(Kirby\Http\Route), 'site') #14 C:\\kirby\src\Cms\App.php(341): Kirby\Http\Router->call('api/site', 'PATCH') #15 C:\\kirby\src\Cms\App.php(1077): Kirby\Cms\App->call(NULL, NULL) #16 C:\\index.php(15): Kirby\Cms\App->render() #17 {main}

I have seen there were similar problems in earlier versions, but i can’t seem to figure out on any of the latest versions. The output doesn’t really help me…