in buildSrc/src/main/java/org/grails/airtable/AirtableBaseApi.java [53:94]
public RecordList list(@NonNull @NotBlank @PathVariable String table,
@Nullable @QueryValue("fields[]") List<String> fields,
@Nullable @QueryValue String filterByFormula,
@Nullable @QueryValue Integer maxRecords,
@Nullable @QueryValue Integer pageSize,
@Nullable @QueryValue List<Sort> sort,
@Nullable @QueryValue String view,
@Nullable @QueryValue CellFormat cellFormat,
@Nullable @QueryValue TimeZone timeZone,
@Nullable @QueryValue UserLocale userLocale) {
try {
return airtableClient.list(HttpHeaderValues.AUTHORIZATION_PREFIX_BEARER + StringUtils.SPACE + airtableConfiguration.getApiKey(),
airtableConfiguration.getApiVersion(),
airtableBaseConfiguration.getId(),
table,
fields,
filterByFormula,
maxRecords,
pageSize,
sort,
view,
cellFormat,
timeZone,
userLocale);
} catch (HttpClientResponseException e) {
if (LOG.isErrorEnabled()) {
LOG.error("HTTPClientResponseException getting records - status {}", e.getStatus());
}
Optional<AirtableApiError> airtableApiErrorOptional = e.getResponse().getBody(AirtableApiError.class);
if (airtableApiErrorOptional.isPresent()) {
AirtableApiError airtableApiError = airtableApiErrorOptional.get();
if (LOG.isErrorEnabled()) {
LOG.error("Airtable API Error - type {} message {}",
airtableApiError.getError() != null ? airtableApiError.getError().getType() : "",
airtableApiError.getError() != null ? airtableApiError.getError().getMessage() : "");
}
}
}
RecordList recordList = new RecordList();
recordList.setRecords(Collections.emptyList());
return recordList;
}