Changeset:
b061874367a1
https://sourceforge.net/p/mrbs/hg-code/ci/b061874367a1bb45cf81b0f271b58f2e99162f04
Author:
Campbell Morrison <[email protected]>
Date:
Thu Sep 29 16:01:04 2016 +0100
Log message:
Removed some more error checking now that we have exceptions.
diffstat:
web/functions_table.inc | 5 -----
web/import.php | 11 ++---------
web/mrbs_sql.inc | 6 +-----
web/report.php | 5 -----
4 files changed, 3 insertions(+), 24 deletions(-)
diffs (81 lines):
diff -r 712c58de7e5c -r b061874367a1 web/functions_table.inc
--- a/web/functions_table.inc Thu Sep 29 15:40:32 2016 +0100
+++ b/web/functions_table.inc Thu Sep 29 16:01:04 2016 +0100
@@ -967,11 +967,6 @@
// Check that we've got a valid, enabled room
$room_name = get_room_name($room_id);
- if ($room_name === FALSE)
- {
- // Should never happen
- fatal_error(FALSE, get_vocab("fatal_db_error"));
- }
if (is_null($room_name))
{
// No rooms have been created yet, or else they are all disabled
diff -r 712c58de7e5c -r b061874367a1 web/import.php
--- a/web/import.php Thu Sep 29 15:40:32 2016 +0100
+++ b/web/import.php Thu Sep 29 16:01:04 2016 +0100
@@ -80,11 +80,8 @@
{
$sql = "SELECT COUNT(*) FROM $tbl_room WHERE room_name=?";
$count = sql_query1($sql, array($location_room));
- if ($count < 0)
- {
- fatal_error(FALSE, get_vocab("fatal_db_error"));
- }
- elseif ($count == 0)
+
+ if ($count == 0)
{
$error = "'$location_room': " . get_vocab("room_does_not_exist_no_area");
return FALSE;
@@ -98,10 +95,6 @@
{
$sql = "SELECT id FROM $tbl_room WHERE room_name=? LIMIT 1";
$id = sql_query1($sql, array($location_room));
- if ($id < 0)
- {
- fatal_error(FALSE, get_vocab("fatal_db_error"));
- }
return $id;
}
}
diff -r 712c58de7e5c -r b061874367a1 web/mrbs_sql.inc
--- a/web/mrbs_sql.inc Thu Sep 29 15:40:32 2016 +0100
+++ b/web/mrbs_sql.inc Thu Sep 29 16:01:04 2016 +0100
@@ -204,10 +204,6 @@
}
$existing[$location][$interval_type][$interval_start] = sql_query1($sql,
$sql_params);
- if ($existing[$location][$interval_type][$interval_start] < 0)
- {
- fatal_error(FALSE, get_vocab("fatal_db_error"));
- }
$proposed[$location][$interval_type][$interval_start] = 1;
}
else
@@ -1326,7 +1322,7 @@
}
else
{
- fatal_error(FALSE, get_vocab("fatal_db_error"));
+ throw $e;
}
}
diff -r 712c58de7e5c -r b061874367a1 web/report.php
--- a/web/report.php Thu Sep 29 15:40:32 2016 +0100
+++ b/web/report.php Thu Sep 29 16:01:04 2016 +0100
@@ -97,11 +97,6 @@
// (We need DISTINCT because it's possible to have two rooms of the
same name
// in different areas)
$options = sql_query_array("SELECT DISTINCT room_name FROM $tbl_room
ORDER BY room_name");
- if ($options === FALSE)
- {
- trigger_error(sql_error(), E_USER_WARNING);
- fatal_error(FALSE, get_vocab("fatal_db_error"));
- }
echo "<div id=\"div_roommatch\">\n";
$params = array('label' => get_vocab("match_room") . ':',
'name' => 'roommatch',
------------------------------------------------------------------------------
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits