Skip to content

Commit 59b502b

Browse files
committed
Merge branch 'feature/add-optional-logging' of github.com:always-open/oxylabs-api into feature/add-optional-logging
2 parents 28608d3 + dd72331 commit 59b502b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

database/migrations/2000_01_01_000001_create_oxylabs_api_reqeust_logger_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{
99
public function up(): void
1010
{
11-
Schema::table('oxylabs_api_request_logger', function (Blueprint $table) {
11+
Schema::create('oxylabs_api_request_logger', function (Blueprint $table) {
1212
$table->id();
1313
// Will store the relative path of the request (e.g. /addresses/validate)
1414
$table->string('path', 191)

src/OxylabsApiClient.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,12 @@ protected function makeRequest(string $method, string $uri, ?array $payload = nu
133133
$response = retry($retryCount ?? 0, function () use ($request, $method, $payload): PromiseInterface|Response {
134134
if (strtolower($method) === 'post') {
135135
return Http::withHeaders($request->getHeaders())
136-
->post($request->getUri(), $payload);
136+
->post($request->getUri(), $payload)
137+
->throw();
137138
} else {
138139
return Http::withHeaders($request->getHeaders())
139-
->get($request->getUri());
140+
->get($request->getUri())
141+
->throw();
140142
}
141143
}, 2000);
142144

0 commit comments

Comments
 (0)