code refactoring

This commit is contained in:
Steffen Schröder
2014-05-02 18:21:38 +02:00
parent fa5752d9ce
commit ac5bbbeafa
11 changed files with 77 additions and 70 deletions

View File

@ -252,9 +252,9 @@ class MapManager implements CallbackListener {
// Download the file
$self->maniaControl->fileReader->loadFile($mapInfo->downloadurl, function ($file, $error) use (&$self, &$login, &$mapInfo, &$update) {
if (!$file) {
if (!$file || $error) {
// Download error
$self->maniaControl->chat->sendError('Download failed!', $login);
$self->maniaControl->chat->sendError("Download failed: '{$error}'!", $login);
return;
}
$self->processMapFile($file, $mapInfo, $login, $update);