0

In the code below, the string "hi" is never outputted.

The MainDispatcher class is just the boostrap of a massive framework with a large application underneath it, which was "working fine until the other day" (I have tried to git-bisect it but that's a story for another post).

How can I find out where the code is silently terminating execution?

require_once "autoload/classes.php";

try {

        $main = new MainDispatcher(root());

        if ($main->httpHeaders()) {
                $main->handleRequest();
        }
echo 'hi';
}
catch(Exception $e) {
echo 'hi';
        Log::error($e, $main->config->traceLog);
}
Alex R
  • 11,364
  • 15
  • 100
  • 180

1 Answers1

0

Move your require_once call inside the TRY block because if this is failing, it doesn't get caught.

Also, if you're unsure how to access the logs and are just debugging, print the exceptions rather than logging them. So in the CATCH block, add a echo $e->getMessage();.

I think you should start seeing the cause of your problem.