|
@@ -249,8 +249,14 @@ class default_1 {
|
|
|
this.get = (type, targetId, params) => {
|
|
|
const { since_id, max_results } = params;
|
|
|
const getMore = (res) => {
|
|
|
- if (res.errors && res.errors.length > 0)
|
|
|
- throw res.errors[0];
|
|
|
+ if (res.errors && res.errors.length > 0) {
|
|
|
+ const [err] = res.errors;
|
|
|
+ if (!res.data)
|
|
|
+ throw err;
|
|
|
+ if (err.title === 'Authorization Error') {
|
|
|
+ logger.warn(`non-fatal error while querying ${type} with id ${targetId}, error: ${err.detail}`);
|
|
|
+ }
|
|
|
+ }
|
|
|
if (!res.meta.next_token ||
|
|
|
utils_1.BigNumOps.compare(res.tweets.slice(-1)[0].id, since_id || '0') !== 1 ||
|
|
|
!since_id && res.meta.result_count >= max_results)
|