Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions components/ILIAS/Init/classes/class.ilErrorHandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private function errorHandler(string $message, int $code, array $backtrace): voi
global $log;

$session_failure = ilSession::get('failure');
if ($session_failure && !str_starts_with($message, 'Cannot find this block')) {
if ($session_failure) {
$m = 'Fatal Error: Called raise error two times.<br>' .
'First error: ' . $session_failure . '<br>' .
'Last Error:' . $message;
Expand All @@ -159,31 +159,6 @@ private function errorHandler(string $message, int $code, array $backtrace): voi
die($m);
}

if (str_starts_with($message, 'Cannot find this block')) {
if ($this->isDevmodeActive()) {
echo '<b>DEVMODE</b><br><br>';
echo '<b>Template Block not found.</b><br>';
echo 'You used a template block in your code that is not available.<br>';
echo 'Native Messge: <b>' . $message . '</b><br>';
echo 'Backtrace:<br>';
foreach ($backtrace as $b) {
if ($b['function'] === 'setCurrentBlock' &&
basename($b['file']) !== 'class.ilTemplate.php') {
echo '<b>';
}
echo 'File: ' . $b['file'] . ', ';
echo 'Line: ' . $b['line'] . ', ';
echo $b['function'] . '()<br>';
if ($b['function'] === 'setCurrentBlock' &&
basename($b['file']) !== 'class.ilTemplate.php') {
echo '</b>';
}
}
exit;
}
return;
}

if ($log instanceof ilLogger) {
$log->write($message);
}
Expand Down
7 changes: 2 additions & 5 deletions components/ILIAS/UI/tests/Renderer/ilIndependentTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,9 @@ public function getFile(string $filename): string
$this->real_filename = $filename;

if (!($fh = @fopen($filename, 'rb'))) {
$this->err[] = (new PEAR())->raiseError(
$this->errorMessage(self::IT_TPL_NOT_FOUND) .
': "' . $filename . '"',
self::IT_TPL_NOT_FOUND
throw new ilTemplateException(
$this->errorMessage(self::IT_TPL_NOT_FOUND) . ': "' . $filename . '"'
);
return "";
}

$fsize = filesize($filename);
Expand Down