Files
scummvm-web/include/ExceptionHandler.php
T
Le Philousophe 649ade2977 WEB: Make index a void function
It's used with Smarty::display which is void so there is never anything
to return and the return value was never checked.
Propagate this change everywhere.
2025-08-24 12:32:46 +02:00

44 lines
970 B
PHP

<?php
namespace ScummVM;
use ScummVM\Pages\SimplePage;
/**
* Handle uncaught exceptions.
*/
abstract class ExceptionHandler
{
private static $exception;
/* If the MenuModel cause the exception we need to skip them. */
public static function skipMenus()
{
$skip_menus = false;
$e = self::$exception;
if (!is_null($e)) {
if (basename($e->getFile()) == 'MenuModel.php') {
$skip_menus = true;
} else {
foreach ($e->getTrace() as $t) {
if (basename($t['file'] ?? '') == 'MenuModel.php') {
$skip_menus = true;
break;
}
}
}
}
return $skip_menus;
}
/* Handle exceptions. */
public static function handleException($e)
{
self::$exception = $e;
$ep = new SimplePage('exception');
$ep->index($e);
}
}