getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.31k stars 168 forks source link

[Panel] "Throw new Exception()" in hooks displays “Please fix all form errors…” message #2165

Closed vauvarin closed 5 years ago

vauvarin commented 5 years ago

Describe the bug
When I use throw new Exception('my message) in a hook, Kirby displays a pop-up with the message “Please fix all form errors…” instead of my message exception.

To Reproduce
Steps to reproduce the behavior:

I can reproduce this issue in the starterkit (Kirby 3.2.5) by adding this in the config file:

return [

    'debug' => true,

    'hooks' => [
        'page.update:after' => function ( $newPage , $oldPage ) {

            throw new Exception('Page Updated');

        }
    ]
];

Expected behavior
throw new Exception('my message) should display a pop-up with the message "my message"

Screenshots

Kirby Version
3.2.5

Console output

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context

afbora commented 5 years ago

Fixed the issue https://github.com/getkirby/kirby/issues/2155