Skip to content

Commit

Permalink
fix: display different type of error objects
Browse files Browse the repository at this point in the history
  • Loading branch information
renickbuettner committed Mar 16, 2024
1 parent 0475f45 commit e63b8be
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/airtable/AirTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ public function getRecords(RecordQueryParams $options): Records
$res = $this->get("{$this->selectedDatabaseId}/{$options->tableId}", $queryParams)->json();

if (isset($res['error'])) {
$this->onError("{$res['error']['type']} {$res['error']['message']}");
$error = is_string($res['error']) ?
$res['error'] :
($res['error']['type'] ?? '' . ' ' . $res['error']['message'] ?? '');
$this->onError($error);
}

while (isset($res['offset'])) {
Expand Down

0 comments on commit e63b8be

Please sign in to comment.