Skip to content

Commit

Permalink
Eliminate LocalizeException
Browse files Browse the repository at this point in the history
  • Loading branch information
dafeder committed Dec 2, 2022
1 parent 0ffb727 commit 368b9b8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
25 changes: 0 additions & 25 deletions modules/datastore/src/Exception/LocalizeException.php

This file was deleted.

7 changes: 1 addition & 6 deletions modules/datastore/src/Plugin/QueueWorker/FileFetcherJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Drupal\datastore\Plugin\QueueWorker;

use Drupal\datastore\Exception\LocalizeException;
use Procrastinator\Job\AbstractPersistentJob;
use Procrastinator\Result;

Expand Down Expand Up @@ -85,8 +84,6 @@ private function getTemporaryFilePath(array $state): string {
*
* @return array
* Array with two elements: state and result.
*
* @throws \Drupal\datastore\Exception\LocalizeException
*/
public function copy(array $state, Result $result): array {
$bytesToRead = 10 * 1000 * 1000;
Expand Down Expand Up @@ -120,8 +117,6 @@ public function copy(array $state, Result $result): array {
*
* @return int
* Bytes written.
*
* @throws \Drupal\datastore\Exception\LocalizeException
*/
private function readAndWrite($fin, $fout, int $bytesToRead): int {
$bytesRead = fread($fin, $bytesToRead);
Expand All @@ -141,7 +136,7 @@ private function readAndWrite($fin, $fout, int $bytesToRead): int {
private function ensureExistsForReading(string $from) {
$fin = @fopen($from, "rb");
if ($fin === FALSE) {
throw new LocalizeException("opening", $from);
throw new \Exception("Error opening file {$from}.");
}
return $fin;
}
Expand Down

0 comments on commit 368b9b8

Please sign in to comment.