Skip to content

Commit 01d6e2e

Browse files
Avoid throwing exception, using abort() instead
1 parent a54333f commit 01d6e2e

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/GcrPubSubQueue.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace RichanFongdasen\GCRWorker;
44

5-
use ErrorException;
65
use Google\Cloud\PubSub\Message;
76
use Kainxspirits\PubSubQueue\Connectors\PubSubConnector;
87
use RichanFongdasen\GCRWorker\Concerns\CreatesPubSubQueue;
@@ -39,8 +38,6 @@ public function acknowledge(Message $message): void
3938
*
4039
* @param Message $original
4140
*
42-
* @throws ErrorException
43-
*
4441
* @return Message
4542
*/
4643
public function pullFreshMessage(Message $original): Message
@@ -59,6 +56,6 @@ public function pullFreshMessage(Message $original): Message
5956
}
6057
}
6158

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

0 commit comments

Comments
 (0)