Skip to content

Commit

Permalink
#9253 Fix temporary file exception name
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr authored and asmecher committed Nov 8, 2023
1 parent f90977a commit dd4c345
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions api/v1/announcements/PKPAnnouncementHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use PKP\announcement\Collector;
use PKP\config\Config;
use PKP\context\Context;
use PKP\core\exceptions\StoryTemporaryFileException;
use PKP\core\exceptions\StoreTemporaryFileException;
use PKP\db\DAORegistry;
use PKP\facades\Locale;
use PKP\handler\APIHandler;
Expand Down Expand Up @@ -223,7 +223,7 @@ public function add($slimRequest, $response, $args)

try {
$announcementId = Repo::announcement()->add($announcement);
} catch (StoryTemporaryFileException $e) {
} catch (StoreTemporaryFileException $e) {
$announcement = Repo::announcement()->get($announcementId);
Repo::announcement()->delete($announcement);
return $response->withStatus(400)->withJson([
Expand Down Expand Up @@ -285,7 +285,7 @@ public function edit($slimRequest, $response, $args)

try {
Repo::announcement()->edit($announcement, $params);
} catch (StoryTemporaryFileException $e) {
} catch (StoreTemporaryFileException $e) {
Repo::announcement()->delete($announcement);
return $response->withStatus(400)->withJson([
'image' => __('api.400.errorUploadingImage')
Expand Down
4 changes: 2 additions & 2 deletions api/v1/highlights/HighlightsHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use APP\facades\Repo;
use Exception;
use PKP\core\APIResponse;
use PKP\core\exceptions\StoryTemporaryFileException;
use PKP\core\exceptions\StoreTemporaryFileException;
use PKP\handler\APIHandler;
use PKP\highlight\Collector;
use PKP\plugins\Hook;
Expand Down Expand Up @@ -170,7 +170,7 @@ public function add(SlimRequest $slimRequest, APIResponse $response, array $args

try {
$highlightId = Repo::highlight()->add($highlight);
} catch (StoryTemporaryFileException $e) {
} catch (StoreTemporaryFileException $e) {
$highlight = Repo::highlight()->get($highlightId, $context?->getId());
Repo::highlight()->delete($highlight);
return $response->withStatus(400)->withJson([
Expand Down
4 changes: 2 additions & 2 deletions classes/announcement/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use APP\file\PublicFileManager;
use PKP\context\Context;
use PKP\core\Core;
use PKP\core\exceptions\StoryTemporaryFileException;
use PKP\core\exceptions\StoreTemporaryFileException;
use PKP\file\FileManager;
use PKP\file\TemporaryFile;
use PKP\file\TemporaryFileManager;
Expand Down Expand Up @@ -237,7 +237,7 @@ protected function handleImageUpload(Announcement $announcement): void
$this->dao->update($announcement);
} else {
$this->delete($announcement);
throw new StoryTemporaryFileException($temporaryFile, $filePath, $user, $announcement);
throw new StoreTemporaryFileException($temporaryFile, $filePath, $user, $announcement);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions classes/highlight/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
use Exception;
use PKP\context\Context;
use PKP\core\Core;
use PKP\core\exceptions\StoryTemporaryFileException;
use PKP\core\exceptions\StoreTemporaryFileException;
use PKP\file\FileManager;
use PKP\file\TemporaryFile;
use PKP\file\TemporaryFileManager;
Expand Down Expand Up @@ -252,7 +252,7 @@ public function getFileUploadBaseUrl(?Context $context = null): string
/**
* Handle image uploads
*
* @throws StoryTemporaryFileException
* @throws StoreTemporaryFileException
*/
protected function handleImageUpload(Highlight $highlight): void
{
Expand All @@ -270,7 +270,7 @@ protected function handleImageUpload(Highlight $highlight): void
$this->dao->update($highlight);
} else {
$this->delete($highlight);
throw new StoryTemporaryFileException($temporaryFile, $filepath, $user, $highlight);
throw new StoreTemporaryFileException($temporaryFile, $filepath, $user, $highlight);
}
}
}
Expand Down

0 comments on commit dd4c345

Please sign in to comment.