Skip to content

Commit e63b8be

Browse files
fix: display different type of error objects
1 parent 0475f45 commit e63b8be

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

classes/airtable/AirTable.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ public function getRecords(RecordQueryParams $options): Records
3131
$res = $this->get("{$this->selectedDatabaseId}/{$options->tableId}", $queryParams)->json();
3232

3333
if (isset($res['error'])) {
34-
$this->onError("{$res['error']['type']} {$res['error']['message']}");
34+
$error = is_string($res['error']) ?
35+
$res['error'] :
36+
($res['error']['type'] ?? '' . ' ' . $res['error']['message'] ?? '');
37+
$this->onError($error);
3538
}
3639

3740
while (isset($res['offset'])) {

0 commit comments

Comments
 (0)