Prevent analyzer from crashing if it is reporting a failure to Airtime
This commit is contained in:
parent
039a51121b
commit
9d0f564190
|
@ -223,6 +223,12 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$whiteList = $this->removeBlacklistedFieldsFromRequestData($requestData);
|
||||
$whiteList = $this->stripTimeStampFromYearTag($whiteList);
|
||||
|
||||
if ($requestData["import_status"] == 2) {
|
||||
$file->setDbImportStatus(2)->save();
|
||||
$this->importFailedResponse();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$this->validateRequestData($file, $whiteList)) {
|
||||
$file->save();
|
||||
return;
|
||||
|
@ -385,6 +391,13 @@ class Rest_MediaController extends Zend_Rest_Controller
|
|||
$resp->appendBody("ERROR: Media not found.");
|
||||
}
|
||||
|
||||
private function importFailedResponse()
|
||||
{
|
||||
$resp = $this->getResponse();
|
||||
$resp->setHttpResponseCode(200);
|
||||
$resp->appendBody("ERROR: Import Failed.");
|
||||
}
|
||||
|
||||
private function invalidDataResponse()
|
||||
{
|
||||
$resp = $this->getResponse();
|
||||
|
|
Loading…
Reference in New Issue