return a 500 on database error

This commit is contained in:
Sarah Hoffmann
2012-03-18 17:58:19 +01:00
parent 57ef20cc7c
commit 4d7e0d97b2
4 changed files with 40 additions and 27 deletions

View File

@@ -48,11 +48,11 @@
$sSQL .= " ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon') as isarea,ST_GeometryType(geometry) as geotype, ST_Y(ST_Centroid(geometry)) as lat,ST_X(ST_Centroid(geometry)) as lon ";
$sSQL .= " from placex where place_id = $iPlaceID";
$aPointDetails = $oDB->getRow($sSQL);
IF (PEAR::IsError($aPointDetails))
if (PEAR::IsError($aPointDetails))
{
var_dump($aPointDetails);
exit;
failInternalError("Could not get details of place object.", $sSQL, $aPointDetails);
}
$aPointDetails['localname'] = $aPointDetails['localname']?$aPointDetails['localname']:$aPointDetails['housenumber'];
$fLon = $aPointDetails['lon'];
$fLat = $aPointDetails['lat'];
@@ -77,8 +77,7 @@
$aPointPolygon = $oDB->getRow($sSQL);
IF (PEAR::IsError($aPointPolygon))
{
var_dump($aPointPolygon);
exit;
failInternalError("Could not get bounding box of place object.", $sSQL, $aPointPolygon);
}
if (preg_match('#POLYGON\\(\\(([- 0-9.,]+)#',$aPointPolygon['outlinestring'],$aMatch))
{