Improved error handling a bit.

This commit is contained in:
defacer 2004-06-25 07:01:08 +00:00
parent ca60b03b34
commit f184e8311f

View File

@ -105,7 +105,7 @@
/// Get and sort the existing blocks
if (!$blocks = get_records('blocks')) {
if (false === ($blocks = get_records('blocks'))) {
error('No blocks found!'); // Should never happen
}
@ -117,6 +117,11 @@
$blockbyname[$blockobject->get_title()] = $block->id;
$blockobjects[$block->id] = $blockobject;
}
if(empty($blockbyname)) {
error('One or more blocks are registered in the database, but they all failed to load!');
}
ksort($blockbyname);
/// Print the table of all blocks