exception fixes

This commit is contained in:
kremsy
2014-02-13 00:26:18 +01:00
committed by Steffen Schröder
parent 071e731537
commit b1921fcc2b
4 changed files with 72 additions and 60 deletions

View File

@ -264,11 +264,6 @@ class ManiaExchangeManager {
$titleId = $this->maniaControl->server->titleId;
$titlePrefix = strtolower(substr($titleId, 0, 2));
// Get MapTypes
$scriptInfos = $this->maniaControl->client->getModeScriptInfo();
$mapTypes = $scriptInfos->compatibleMapTypes;
// compile search URL
$url = 'http://' . $titlePrefix . '.mania-exchange.com/tracksearch?api=on';
@ -284,8 +279,15 @@ class ManiaExchangeManager {
$url .= '&priord=' . $searchOrder;
$url .= '&limit=' . $maxMapsReturned;
$url .= '&mtype=' . $mapTypes;
// Get MapTypes
try {
$scriptInfos = $this->maniaControl->client->getModeScriptInfo();
$mapTypes = $scriptInfos->compatibleMapTypes;
$url .= '&mtype=' . $mapTypes;
} catch(\Exception $e) {
//dont append map tpye
}
$fileFunc = function ($mapInfo, $error) use (&$function, $titlePrefix) {
if ($error) {