/** * Stash the file and return the file key * Also re-raises exceptions with slightly more informative message strings (useful for API) * @throws MWException * @return string File key */ private function performStash() { try { $stashFile = $this->mUpload->stashFile(); if (!$stashFile) { throw new MWException('Invalid stashed file'); } $fileKey = $stashFile->getFileKey(); } catch (MWException $e) { $message = 'Stashing temporary file failed: ' . get_class($e) . ' ' . $e->getMessage(); wfDebug(__METHOD__ . ' ' . $message . "\n"); throw new MWException($message); } return $fileKey; }