introduce chksql function for website code and move other fail functions

The default error screen now reports the full SQL even when not
in debug mode as this message is often more helpful than our
custom error message.
This commit is contained in:
Sarah Hoffmann
2016-06-12 14:34:57 +02:00
parent 7a50d2f996
commit 95961d098d
9 changed files with 116 additions and 78 deletions

View File

@@ -10,13 +10,14 @@
$oDB =& getDB();
$sSQL = "select placex.place_id, calculated_country_code as country_code, name->'name' as name, i.* from placex, import_polygon_delete i where placex.osm_id = i.osm_id and placex.osm_type = i.osm_type and placex.class = i.class and placex.type = i.type";
$aPolygons = $oDB->getAll($sSQL);
if (PEAR::isError($aPolygons))
{
failInternalError("Could not get list of deleted OSM elements.", $sSQL, $aPolygons);
}
$aPolygons = chksql($oDB->getAll($sSQL),
"Could not get list of deleted OSM elements.");
//var_dump($aPolygons);
if (CONST_DEBUG)
{
var_dump($aPolygons);
exit;
}
?>
<!DOCTYPE html>
<html>