Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

fix:TooManyRequestsWaiter Exception didn't catch #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Dotenv\Dotenv;
use Hitrov\Exception\ApiCallException;
use Hitrov\Exception\TooManyRequestsWaiterException;
use Hitrov\FileCache;
use Hitrov\OciApi;
use Hitrov\OciConfig;
Expand Down Expand Up @@ -112,6 +113,9 @@

// current config is broken
return;
} catch(TooManyRequestsWaiterException $e) {
echo $e->getMessage();
return;
}

// success
Expand Down
2 changes: 1 addition & 1 deletion src/OciApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function createInstance(
if (isset($this->waiter) && $this->waiter->isConfigured()) {
if ($this->waiter->isTooEarly()) {
throw new TooManyRequestsWaiterException(
"Will retry after {$this->waiter->secondsRemaining()} seconds",
"TooManyRequests, Will retry after {$this->waiter->secondsRemaining()} seconds",
);
}

Expand Down