H
H
heartdevil2017-09-25 12:43:30
PHP
heartdevil, 2017-09-25 12:43:30

Why doesn't try catch work on a variable that is executed as a function?

There is a block of code:
There is a function in $process that is not available (I mean it should not be called)
I'm trying to catch this function, but I don't understand why I can't catch it. The exception still crashes and the ketch does not work.

foreach ($element['#process'] as $process) {
        try 
        {
                $element = $process($element, $form_state, $form_state['complete form']);
        }
        catch(Exception $e)
       {
            xdebug_var_dump($element);
       }

EDIT:
Error message:

Error: Call to undefined function bootstrap_form_process() in form_builder() (line 1873 of /usr/share/nginx/html/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2017-09-25
@heartdevil

What's the error?
If syntactic, then it will continue to fall, it falls at the start, and not during execution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question