Skip to content

Commit

Permalink
Avoid throwing exception, using abort() instead
Browse files Browse the repository at this point in the history
  • Loading branch information
richan-fongdasen committed Nov 9, 2021
1 parent a54333f commit 01d6e2e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/GcrPubSubQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace RichanFongdasen\GCRWorker;

use ErrorException;
use Google\Cloud\PubSub\Message;
use Kainxspirits\PubSubQueue\Connectors\PubSubConnector;
use RichanFongdasen\GCRWorker\Concerns\CreatesPubSubQueue;
Expand Down Expand Up @@ -39,8 +38,6 @@ public function acknowledge(Message $message): void
*
* @param Message $original
*
* @throws ErrorException
*
* @return Message
*/
public function pullFreshMessage(Message $original): Message
Expand All @@ -59,6 +56,6 @@ public function pullFreshMessage(Message $original): Message
}
}

throw new ErrorException(sprintf('Failed to pull a PubSub message with id "%s"', $original->id()));
abort(409, sprintf('Failed to pull a PubSub message with id "%s"', $original->id()));
}
}

0 comments on commit 01d6e2e

Please sign in to comment.